fix: allow settings navigation with stable navigator
This commit is contained in:
1 parent
945f0d4051
commit
6c3df9cd16
1 file changed
+6
-1
@@ -13,7 +13,12 @@ class SettingsButton extends StatelessWidget {
|
|||||||
// Opens the settings page sliding in from the right — matches the
|
// Opens the settings page sliding in from the right — matches the
|
||||||
// sidebar end-drawer animation so it feels like one continuous motion.
|
// sidebar end-drawer animation so it feels like one continuous motion.
|
||||||
static void open(BuildContext context) {
|
static void open(BuildContext context) {
|
||||||
Navigator.of(context).push(
|
openWithNavigator(Navigator.of(context, rootNavigator: true));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void openWithNavigator(NavigatorState navigator) {
|
||||||
|
if (!navigator.mounted) return;
|
||||||
|
navigator.push(
|
||||||
PageRouteBuilder(
|
PageRouteBuilder(
|
||||||
transitionDuration: const Duration(milliseconds: 300),
|
transitionDuration: const Duration(milliseconds: 300),
|
||||||
reverseTransitionDuration: const Duration(milliseconds: 250),
|
reverseTransitionDuration: const Duration(milliseconds: 250),
|
||||||
|
|||||||
Reference in new issue
Block a user