Use this tag for questions about the Flutter's go_router package.
Questions tagged [flutter-go-router]
266 questions
0
votes
1 answer
How to return the existing (current) route from go_router?
I'm using go_router_builder to build routes. Here's one:
class FooRoute extends GoRouteData {
final bool condition;
FooRoute(this.condition);
@override
Widget build(BuildContext context, GoRouterState state) {
return condition ?…

iDecode
- 22,623
- 19
- 99
- 186
0
votes
1 answer
go router shellRoute builder function not called on context.push()
On using context.push('/profile/check'); the builder function isn't called and hence the Text("Check") shows inside the AppScaffold.
late final GoRouter router = GoRouter(
initialLocation: '/',
refreshListenable: appService,
…

Rohan
- 57
- 3
- 10
0
votes
1 answer
Flutter: go_router 6.0.1 KEYCODE_BACK throw null safety error in ShellRoute
In my application I have ShellRoute, which I use for BottomNavigation. If I use the system back button or gesture on the selected tab, I get a null safety error and I don't know how to get rid of it.
The error occurs in delegate.dart in class…

Zelkreps
- 11
- 3
0
votes
2 answers
go_router using browser back button extra is null flutter web
let's say I navigate from page a with context.push() and pass extra to page b.
then if I navigate to page c and then press the browser back button to go back to page b now extra is null and page shows error.
any solutions?
I think we can use query…

Sepehr Marashi
- 111
- 1
- 1
- 4
0
votes
1 answer
GoRouter swipe back gesture is not detected
Hi i am using GoRouter to build my app's navigation but it doesn't detect the swipe back gestures of android and ios, it goes back and renders the correct page but i don't see the state.subloc changes inside my redirect function of my GoRouter. Is…

devberkay
- 144
- 13
0
votes
2 answers
Can a Map of data be passed as a parameter in go_router?
I want to pass a map of complex data as a parameter to a GoRoute(). However, from what I can see, the param is a String. I tried converting my Map -> String, but it immediately causes all sorts of errors due to format errors: Unexpected character…

Mark
- 3,653
- 10
- 30
- 62
0
votes
1 answer
go_router package is not supporting hot reload on chrome in Flutter
Can you please help me with a solution to a problem that I am facing using go_router package in my flutter application.
Sample code:
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
final _router = GoRouter(
…

jack wilson
- 1
- 1
0
votes
0 answers
How to get route history and queryParameters
My goRouter like:
GoRouter(initialLocation: '/', routes: [
GoRoute(
path: '/',
builder: (context, state) => HomeScreen(),
routes: [
GoRoute(
path: 'page1',
name: 'page1',
builder: (context, state) =>…

tatsuyuki
- 197
- 1
- 11
0
votes
0 answers
How to access context when using go_router and bloc in handler auf StreamSubscription
I ended up non this but I do not think it is the way to go:
void doSomething(BuildContext context, MyDatadata) {
late StreamSubscription subscription;
subscription = BlocProvider.of(context,…

derChris
- 726
- 8
- 19
0
votes
0 answers
Maintaining Provider State - Flutter Web
Is there a way to maintain the provider state after refreshing the browser in Flutter Web without any support from SharedPreferences?
I tried go_router but that doesn't help either.

Kennedy Njagi
- 1
- 1
0
votes
1 answer
Go_router pass an object/bloc to new route
I use to pass a BLoC instance to a new route like so :
Navigator.of(context).push

Sunshine
- 372
- 2
- 21
0
votes
2 answers
Global navigation key with GoRouter and Riverpod Providers
I combined Firebase auth, riverpod, and Gorouter via Luca Venir's repository here. It really works great. Now my issue is that I'm making a web app, and I don't know how to access the GoRouter routes that are inside the routerProvider to change the…

Hunter Books
- 372
- 2
- 11
0
votes
0 answers
How to debug multiple widgets used the same GlobalKey
I'm getting the following error thrown randomly (in Flutter Web) and unfortunately, I can't ping it to any recent change I have done. E.g. I can navigate between the dashboard screen and the blog screen as often as I want, but if I refresh the page…

schneida
- 729
- 3
- 11
- 37
0
votes
1 answer
Subroute data management using go_router in Flutter
I have a conceptual question about how Flutter goes about data/state management when using go_router navigation. My app has a homepage containing a calendar that shows a list of events from a database (using the riverpod package to listen to the API…

Wessel
- 617
- 4
- 13
0
votes
0 answers
Flutter Web - context.replace not behaving as expected
I was trying to run flutter web sample with go_router package using navigator 2 flow. I wanted to achieve something like, on press of a button current route should be replaced by new route and on back press of a chrome browser it should go to…

Jay Mungara
- 6,663
- 2
- 27
- 49