Replies: 2 comments 1 reply
-
In go_router (and Navigator 2.0), you can go anywhere you want just by specifying the path to the location like in a website. For example, say we have the 3 pages; Adding the following app bar to any page in the NavigationSheet of the AI playlist generator example could be a good example of this mechanism. appbar: AppBar(
actions: [
IconButton(
// Returns to the home from any page in the sheet
onPressed: () => context.go('/'),
icon: const Icon(Icons.close),
),
],
), |
Beta Was this translation helpful? Give feedback.
-
Then I think this is the only solution as far as I understand it. |
Beta Was this translation helpful? Give feedback.
-
I use
GoRouter
withShellRoute
's as described in the examples. Inside the modal navigation I want topop
the whole modal sheets (the wholeShellRoute
including sub-routes).When creating the
NavigationSheet
I also tried looking intoSheetController
class, but it does not have any method to dismiss the page manually.This would be useful with a close button on any sheet.
Right now I've come up with this solution:
Which looks like an antipattern to using GoRouter solely.
What can be done in this case?
Beta Was this translation helpful? Give feedback.
All reactions