Questions tagged [flutter-go-router]

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

266 questions
2
votes
1 answer

How can you access GoRoute state.params outside of the routing process?

I hope some simple pseudocode is enough so that both me and you can understand the question and answer. The problem I'm facing is especially hard when using flutter-web, where the refresh restarts the whole program. I want to use the path parameters…
2
votes
2 answers

Equivalent of Navigator Arguments in Flutter Go Router

What will be equivalent of the below Flutter Navigator in terms of Go Router? Navigator.pushNamed( context, Routes.CHANNEL_PAGE, arguments:ChannelPageArgs( channel:channel, initialMessage:message, …
Purus
  • 5,701
  • 9
  • 50
  • 89
2
votes
1 answer

WillPopScope not working with go_router web Flutter

WillPopScope( onWillPop: () async { log('WillPopScope: working in call'); return new Future(() => true); } child: Scaffold() ) I am using go_router for navigating through pages in Web. Here onWillPop seems to be never called. How can we…
Mahboob Ahmed
  • 93
  • 1
  • 7
2
votes
0 answers

Flutter show GetX snackbar fails with GoRouter

I am using the go_router in my app and also the get package. The problem is that since I implemented the Go-Router I can no longer show the Get.snackbar. It is failing and throwing a null-error. For the GoRouter to work I had to add the .router for…
Chris
  • 1,828
  • 6
  • 40
  • 108
1
vote
1 answer

Riverpod StateNotifierProvider not updating Widget on state update after async call

In Flutter Web, I depend on StateNotifierProvider to fetch data from API call and using another widget to update this API need to trigger the state change to do a refetch. I use ref.watch for viewing the data and refetch data by ref.read. However,…
Anddo
  • 2,144
  • 1
  • 14
  • 33
1
vote
1 answer

How to avoid route duplication in flutter go_router?

I have 3 categories of products laptops, desktops, mobiles. on each category page there is a list of products which on clicking shows product details page. to pop back to category list page from product details page I've added product details page…
1
vote
2 answers

Flutter: keyboard disappears immediately when focus on TextField

When I click on the text field to start writing, the text field appears and disappears immediately. I tried to remove the ScreenUtil widgets and it's worked but I also tried to replace the GoRouter with on generate route by removing the ScreenUtils…
1
vote
0 answers

Go router navigation with splash screen on init and list of pages Flutter

I was trying to solve this problem for several days with no luck. I am just extremely confused with go router logic... I am building a little platform. When user opens my web app, it checks the URL path and changes several things like colors and…
Feinliebe
  • 67
  • 3
1
vote
2 answers

How to hide BottomNavigationBar in specific routes using GoRouter in Flutter?

https://github.com/flutter/packages/blob/main/packages/go_router/example/lib/others/custom_stateful_shell_route.dart In this code, the ButtomBar is always displayed even when details is displayed. However, I would like to hide the ButtomBar when I…
musako
  • 897
  • 2
  • 10
  • 26
1
vote
1 answer

Flutter go_router: push() vs go() and web URL changes

I am facing a use case I don't know the proper way to deal with. Please see here the simple application I have made: https://dartpad.dev/?id=5a00b315613990d8c3ead6e26bc2df4c This tries to simulate the typical scenario where you have a record list…
rocotocloc
  • 418
  • 6
  • 19
1
vote
1 answer

How to dispose a screen BEFORE the new screen is initialized, during go_router navigation?

I have a Screen A that is calling context.pushReplacement(ScreenA.route), which means it is calling pushReplacement on itself. The problem is, the new copy of Screen A is initialized BEFORE the old Screen A is disposed. This is a problem since I am…
jpegoraro
  • 315
  • 2
  • 10
1
vote
0 answers

Flutter go_router, StatefulShellRoute with Drawer

I have an app where the home screen has two tabs; for handle the TabBar navigation i use a StatefulShellRoute where i pass the tabs to HomeScreen screen with the navigatorContainerBuilder param. In the HomeScreen i have a Drawer that has other app…
Daniel Valencia
  • 451
  • 7
  • 9
1
vote
1 answer

Go router ShellRoute for widget is resulting in error

I'm trying to build a website with a top navbar, content and a footer. I am using go router to navigate between different page content while retaining the navbar and footer. This is my implementation, but I'm getting a blank screen with this log: Go…
1
vote
1 answer

(go-router) Refresh riverpod state when going to a previous page

I am using using go_router 9.0.1 and go_router_builder 2.2.0 with riverpod 2.3.6. I have implemented go_router in my project and by default the package maintain the state of the previous page when using going to a sub-route. In my case I want that…
Madere
  • 50
  • 6
1
vote
0 answers

Flutter GoRouter deep links how to change the Gorouter of a context

I'm building a large application that will need a deep links, I choose GoRouter to implement the routing system but found all the examples and tutorials about deep links very simple none of them describe a routing system of large application. I want…
Maya Amor
  • 53
  • 4