Questions tagged [flutter-go-router]

Use this tag for questions about the Flutter's go_router package.

266 questions
22
votes
5 answers

Flutter: go_router how to pass multiple parameters to other screen?

In a vanilla flutter I use to pass multiple parameters to other screen like this: Navigator.of(context).push(MaterialPageRoute( builder: (_) => CatalogFilterPage( …
IBlackVikingl
  • 643
  • 2
  • 7
  • 20
17
votes
4 answers

How to work with NavigationBar in go_router? | Flutter

I am currently struggling refactoring my routing code with go_router. I already got some simple routes like /signin & /signup, but the problem comes in when I try to make the routing work with a BottomNavigationBar that has multiple screens. I would…
Florian Leeser
  • 590
  • 1
  • 6
  • 20
16
votes
1 answer

How to return to a nested route when switching between tabs with ShellRoute and GoRouter 5.0?

I’m trying to get nested navigation to work with ShellRoute in go_router 5.0. As the example below shows, I can correctly navigate to the (nested) product page when clicking on a product. But if I switch to the cart tab and back to products, I'm…
bizz84
  • 1,964
  • 21
  • 34
13
votes
1 answer

What is the difference between builder and pageBuilder in the Go Router package?

In the Flutter go_router package, there are apparently two ways of creating a new page, with either a builder or a pageBuilder: GoRoute( name: 'Route', path: '/route', builder: (BuildContext context, GoRouterState state) => const…
Philippe Fanaro
  • 6,148
  • 6
  • 38
  • 76
13
votes
3 answers

Go Router (Flutter)- push the exact same route and refresh that route

With GoRouter, Is there a way to push the exact same route with a different parameter and make the page reload? I am thinking of something like Navigator.pushReplacement I am using context.go('/my_page/?param={someID}') to push to MyPage (a stateful…
Peter Irving
  • 305
  • 2
  • 10
8
votes
3 answers

Flutter go_router, how to get the whole current stack of pages?

Meaning if I go from a job screen to a client screen (the client the job was for), to another job screen (another job done for the client) etc, how can I display job > client > job? And including parameters, so I could display Job 12 > SomeCompany >…
Tristan King
  • 438
  • 4
  • 17
8
votes
1 answer

How to display alert dialog box on back button of browser or onReload the page using Go Router in flutter web?

I am working on the Flutter web and using go_router for navigation. Expectation: From the initial route, When the user tries to navigate back using the browser back button or reload the page, an alert box should be displayed and ask, "Are You sure…
7
votes
0 answers

How to work with flutter_bloc 8+, go_router +6 and refreshListenable

I'm using go_router for navigation and flutter_bloc for my state management. I would like to use refreshListenable and listen to my AuthBloC events in my GoRouter configuration, however, I don't have access to context in my GoRouter, and I would…
7
votes
1 answer

Universal link opens the flutter app but does not go to the right page

On iOS, when I click on a url, it opens my Flutter app but stays on the main screen. It does not go to the given page. For example, if the link is https://my-app.com/page1, the app will just go to / Here's the…
Gpack
  • 1,878
  • 3
  • 18
  • 45
7
votes
2 answers

go_router and flutter_bloc: Unhandled Exception: No GoRouter found in context

I have wrapped the MaterialApp with a BlocProvider / BlocListener I get an error "Unhandled Exception: 'package:go_router/src/router.dart': Failed assertion: line 280 pos 12: 'inherited != null': No GoRouter found in context" from the Listener…
fvisticot
  • 7,936
  • 14
  • 49
  • 79
6
votes
2 answers

How to pass a bloc to another screen using go_router on flutter

On Flutter I would like to pass a local bloc to another screen. This is how I used to pass a bloc to a new route when using the default navigator. Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) => …
Abdi mussa
  • 171
  • 11
5
votes
0 answers

How to use a parameterized route as the root of a StatefulShellRoute with GoRoute

I have a flutter app that I wanted to add stateful navigation to. I wanted to have it so that you can look at the list of "Foos" and then choose a Foo to look at. On the Foo detail page I wanted to have 3 tabs and have stateful navigation on those…
user977208
  • 603
  • 2
  • 5
  • 13
5
votes
1 answer

Getting deployment failure due to go_router package in flutter web

I am getting deployment failure due to go_router pkg. Here the error. [91mTarget dart2js failed: Exception: /root/.pub-cache/hosted/pub.dev/go_router-3.1.1/lib/src/go_router.dart:22:44: Step #0 - "docker-build": Error: The class 'NavigatorObserver'…
Subodh Kumar
  • 229
  • 3
  • 8
5
votes
1 answer

How Do I Show a Dialog in Flutter Using a go_router Route?

I am currently using showGeneralDialog to present a dialog popup like this: This is all fine and good, but it happens at the root Navigator level, and I would rather have all my views as a Go Router route so that I can control their presentation in…
Clifton Labrum
  • 13,053
  • 9
  • 65
  • 128
5
votes
1 answer

Flutter Go Router no back button and nothing to pop

I am using Go Router on my flutter project and I noticed that the back button is not presented anymore. Even when I specifically add it I get the following error: ======== Exception caught by gesture …
John
  • 1,697
  • 4
  • 27
  • 53
1
2 3
17 18