Questions tagged [flutter-go-router]

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

266 questions
0
votes
0 answers

GoRouter passing wrong arguments to the route when I press on `Select Widget` in flutter inspector

I have this route with two nested routes: GoRoute( parentNavigatorKey: _homePageShellNavigatorKey, name: MenuScreen.routeName, path: '/menu_screen', pageBuilder: (_, state) { …
HII
  • 3,420
  • 1
  • 14
  • 35
0
votes
0 answers

Code inside initState not getting executed when using go_router flutter

So I have a GroupedRestaurantPage and a SingleRestaurantPage. Here is a minimalistic router code: final router = GoRouter( initialLocation:'/', routes:[ GoRoute( name:rootRoutName, path:'/', builder:(context, state) => const…
Abdi mussa
  • 171
  • 11
0
votes
1 answer

flutter go_router How to remove other routes in the routing line?

My current routing line is A -> B -> C -> D now, I am on page D , i want to remove B . What should I do? I searched in the issue and found no answer
Zhuoyuan.Li
  • 318
  • 2
  • 10
0
votes
0 answers

Is there any way to prevent user from popping the screen on Flutter web with Router API?

I have a Flutter web app with Router API (go_router) for navigation. As for now, WillPopScope widget doesn't work with go_router on the web (issue tracker is here). Is there any other way to prevent user from quitting (popping) page (not browser…
Abigotado
  • 75
  • 6
0
votes
0 answers

How to clear previous routes in GoRouter in Flutter

I am working on a application where user can create group and redirected on a message List screen. Now when user creates group i want to clear all previous routes and redirect user on a message screen. Currently once group is created user is…
0
votes
0 answers

Flutter GoRouter Shell Route with Parent Navigator Key

Using GoRouter, a GoRoute can be added a parent ShellRoute's navigator by using the parentNavigatorKey property. However, there are certain situations where it would be necessary for that GoRoute's direct parent ShellRoute to also be added along…
Walrus
  • 19,801
  • 35
  • 121
  • 199
0
votes
0 answers

How to animate a scaffold?

I want to show a "welcome" page for a few seconds before showing the home screen. This is the working code showing just the home page (no transitions): @override Widget build(BuildContext context) { return Scaffold( …
0
votes
1 answer

Push a transparent page with go_router?

In order show a drawer that covers my shellroute, i need to push a semi-transparent page on top of my page stack. So far the background remain opaque when i use the GoRouter.of(rootNavigatorKey.currentContext!).pushNamed('myDrawer'); I have found a…
Jerbs
  • 131
  • 1
  • 8
0
votes
2 answers

Flutter Add action icons to AppBar while using go_router

I want to add action icons to my AppBar as shown in this Flutter example However I'm using go_flutter and I can't see any property in the MaterialApp.router constructor that would allow to insert icon widgets. Here's my code so far. How can I add…
Duddy67
  • 836
  • 2
  • 10
  • 26
0
votes
1 answer

How to create a new instance or hand over an existing one when using Bloc or Cubit in the Go_Router package

Flutter Question You are about to go from page A to page B. Create CubitA as a BlockProvider, and put page B in child. In B, go to page C with CubitA. (Use BlockProvider.value) But sometimes I have to move from C to page B. At this point, it moves…
seokseok
  • 21
  • 2
0
votes
1 answer

Flutter go_router How to handle unknown route?

How can I handle the unknown routes navigation in the app with go_router ^6.5.0 in Flutter, so when GoRouter doesn't have the route needed to be navigated it opens UnknownRoutePage(originalLocation)?
Sergiy Vergun
  • 91
  • 1
  • 8
0
votes
1 answer

Alternative to pushAndRemoveUntil in go router in flutter

Lets say I have navigation stack like HomeScreen-> CartScreen -> OrderScreen -> AddressScreen -> ConfirmationScreen -> OrderSuccessScreen Now i want to push a named route say OrderSuccessScreen when I am in ConfirmationScreen, and remove all the…
krishnaacharyaa
  • 14,953
  • 4
  • 49
  • 88
0
votes
0 answers

I want when user click on logo image it should get redirected to the initial home page I am using Go Router Package

I am using Go router package for routing in my flutter web page this is my main page class Prasthan extends StatelessWidget { const Prasthan({super.key}); // This widget is the root of your application. @override Widget build(BuildContext…
0
votes
0 answers

Use context in global scope with go_router

I want to use go_router guideline to create GoRouter object in global scope but I can not figure out how to add a refreshListenable argument. final go_router = GoRouter( refreshListenable: GoRouterRefreshStream( …
zex_rectooor
  • 692
  • 7
  • 26
0
votes
1 answer

GoRouter navigation not working, although there is no errors in Flutter

Navigation doesn't work. I added GoRouter.of(context).goNamed(AppPage.profile.toName) to the button to navigate by name but nothing happens. Not even errors. I tried using push, go, goNamed but nothing helps at all and navigation doesn't work. There…
Max
  • 1,141
  • 2
  • 11
  • 34