Use this tag for questions about the Flutter's go_router package.
Questions tagged [flutter-go-router]
266 questions
0
votes
0 answers
Flutter bloc "Firebase Login Tutorial" replace FlowBuilder with go_router
I try understand and replace the FlowBuilder of the Firebase Login Tutorial with the go_router package. The Login and Logout works ok, only the navigation needs context.goNamed("..."). go_router has an example for dynamic redirection so I would not…

Michael S
- 731
- 2
- 10
- 26
0
votes
0 answers
Flutter: Cannot pass a boolean type parameter through GoRouter
I want to pass a bool type parameter through GoRouter but I get this message error:
The argument type String cannot be assigned to the parameter type "bool"
But I can't really figure out where this error comes from.
Is String the only allowed type…

Duddy67
- 836
- 2
- 10
- 26
0
votes
0 answers
Sub routes with extra object in go_router
Is there any ways to pass parameters(or extra Object) with sub routes?
When navigating PageA from PageB, type 'Null' is not a subtype of type 'int' error has occurred.
final _router = GoRouter(
debugLogDiagnostics: true,
initialLocation: '/',
…

Masahiro Aoki
- 815
- 12
- 22
0
votes
2 answers
How can I disable the error page with flutter go router and have a snackbar instead?
With flutter go router is it possible to disable the error page? Because I want the error to show in a snackbar instead. I tried doing it in the redirect but the error in the redirect seems empty when for example you route to a page that does not…

anonymous-dev
- 2,897
- 9
- 48
- 112
0
votes
1 answer
Having Flutter gorouter redirect property doesn't let navigation work
Having Flutter gorouter redirect property at top-level doesn't let navigation to go to/push any other page. It redirects to initialLocation upon pressing routing button instead of intended page(ItemOne()).
Log:
[GoRouter] going to /one
[GoRouter]…

Anmol Singh
- 393
- 3
- 16
0
votes
0 answers
Page always visible in Flutter
I have a app that was developed with FlutterFlow and I`m implementing Google AdMob in it. I need a page that will always be visible in my app life cycle, this page is holding the AdMob banner.
I have already created the page, my problem is: how can…

Lucas
- 1
- 2
0
votes
1 answer
Is there a way to inject a widget UNDER the Navigator with GoRouter?
In the MaterialApp constructor, I am injecting a widget in the builder method to handle push notifications. To process foreground notification, I would like to use this widget to show a notification bar (using another_flushbar) but I need a…

Sebastien
- 3,583
- 4
- 43
- 82
0
votes
2 answers
Flutter web + go_router, when direct visit to: /page, how to go back to / (root)
I am using go_router and got such config:
final router = GoRouter(
initialLocation: '/',
routes: [
GoRoute(path: '/', pageBuilder: (context, state) => const MaterialPage(child: MyHomePage(title: 'Flutter Demo Home Page')),),
…

Tom Raganowicz
- 2,169
- 5
- 27
- 41
0
votes
0 answers
Flutter testing: No GoRouter found in context
I want to test my ViewModel that goes to a named route with GoRouter. Therefore, I pass my context from my View to the ViewModel. My problem is that the mocked contains does not contain a GoRouter. I get the error "No GoRouter found in context". How…

maxmitz
- 258
- 1
- 4
- 17
0
votes
0 answers
I want to hero screen home to questio-detail ( but can not when I use go router )
ShellRoute(
navigatorKey: _shellNaigationkey,
builder: (context, state, child) {
return HeroControllerScope(
controller: MaterialApp.createMaterialHeroController(),
child:…

Van Nak
- 61
- 1
- 5
0
votes
1 answer
How to show a persistant BottomModalSheet that remains in all tabs
I'm creating an app that requires a bottomModalSheet to stay persistant in all (Bottom) tabs regardless of which one I select.
I've gotten it to work on a single BottomTab, but once I click on the other it loses it's state and the Modal is gone as…

Shahan Ahmed
- 11
- 2
0
votes
1 answer
Display multiple pages at the same time
I have an app with two features, that have routes such as:
/feature1
/feature1/a
/feature2
/feature2/a
/feature2/a/b
/feature2/c
I can use GoRouter and its ShellRoute to switch between these one at a time using context.goNamed('feature2'), which…

Jaween
- 374
- 1
- 3
- 10
0
votes
0 answers
How to Use ShellRoute with go_router and Nested Grandchildren
Flutter 3.3.10 & go_router 6.0.1
I have created a sample Flutter app for desktop that has a navigation bar on the left. I want my routes to navigate only to the right of the nav so the nav is persistent and never changes. Only the content in the…

Clifton Labrum
- 13,053
- 9
- 65
- 128
0
votes
1 answer
No GoRouter found in context in widget tests
I'm trying to mock go_router in my widget tests but keep getting this error:
══╡ EXCEPTION CAUGHT BY GESTURE ╞═══════════════════════════════════════════════════════════════════
The following assertion was thrown while handling a gesture:
No…

chinloyal
- 1,023
- 14
- 42
0
votes
1 answer
Go Router does not redirect to original path after authentication
I am trying to implement redirection in my GoRouter so that if it finds the user is not authenticated then it will direct them to a login page otherwise proceed as-is.
My implementation works fine for when the user needs to be redirected to login,…

Saqlain
- 191
- 1
- 8