Questions tagged [flutter-go-router]

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

266 questions
0
votes
1 answer

context.go("/home") not working inside listener of BlocConsumer()

Why go router context.go("/routeName") is not working inside BlocListener or BlocConsumer? i'm currently using flutter_bloc and go router. In the signup page once user submitted the details i'm sending a request to backend. once i got the token from…
0
votes
0 answers

Flutter 3.10.0 popping fails with GoRouter

I am using the GoRouter with the lates 3.10.0 release but after upgrade the flutter version my app fails with this error: _AssertionError ('package:go_router/src/delegate.dart': Failed assertion: line 158 pos 12: 'match != null': is not…
Chris
  • 1,828
  • 6
  • 40
  • 108
0
votes
1 answer

Flutter Provider context not listening with rootNavigatorState

I need to access a value of a provider but I can't pass a context so I created created a global navigatorKey like this: final rootNavigatorKey = GlobalKey(); and set it in my app. Now I have a function that should listen to my…
Chris
  • 1,828
  • 6
  • 40
  • 108
0
votes
0 answers

How to define Type-safe for return value in go_route_builder Flutter?

I would like to specific return type for push method in go_route/go_route_builder but i cant find any document about that. What i did: @TypedGoRoute(path: '/my-screen') class MyRoute extends GoRouteData { @override Widget…
0
votes
0 answers

I'm unable to push a new route when using ShellRoute

I'm building a sleep analysis app using Flutter, and I just started using go_router to manage all my routes. I have what I'll describe as my main screen, which is 4 screens with a nested navigation bar. Some of theses routes have subroutes: let's…
0
votes
1 answer

Flutter: Redirect to home screen on error is buggy using `go_router`

Details: I am using Riverpod for state management and go_router for route management. Expected Behavior: When Flutter throws an error, it will redirect to the home-screen of the app and then continue to work normally. Actual Behavior: After…
Jelkimantis
  • 138
  • 1
  • 10
0
votes
0 answers

Go Router Builder gives error on building

I have some simple pages and lists I want to navigate, they all work fine apart from when I add one layer deeper navigation after a list. Here's the code for my routes: part 'routes.g.dart'; final GlobalKey _shellNavigatorKey = …
Tristan King
  • 438
  • 4
  • 17
0
votes
0 answers

Are there better ways of structuring things and also question regarding routing/MaterialApp

I made a simple snapshot of my app architecture so far. I am learning flutter on my own and i would like to hear from experts if this is good so far? my biggest decisions that so far were where to place the authStateChanges stream from firebase…
miguel
  • 1
  • 3
0
votes
1 answer

Are we able to hide the query parameter in flutter web while navigating through go_router?

Assume that I have to hide a few essential parameters which are sent through go_router's query params like - " GoRouter.of(context).pushNamed(route, queryParameters: { 'id': 'hhhhhh', 'key': 'yyyyy' }); I don't want to let the user see the Id, is…
0
votes
0 answers

Go_Router redirects me to '/register' page everytime i try to navigate routes using context.push('/anylocation') in my UI (redirect gets triggered)

so basically i dont see what i am doing wrong. everything makes sense to me, must be some minor thing that is escaping me. but basically i created my routes and in there i have a redirect property which is conditional of the authentification state.…
miguel
  • 1
  • 3
0
votes
0 answers

Go router navigation with page refresh on return

Our app has grown significantly over the last year. We’ve added a lot of features and also added push notifications and deep links which require a better approach when it comes to navigation. We’re currently using Navigator only and we’re thinking…
codinator
  • 1
  • 1
  • 5
0
votes
0 answers

Flutter Authentication - MobX + GoRouter

I'm building an app and I intend to use MobX, but I need some route manager so that if the user logs off, it is redirected to the login screen again. However, the go_router package has a variable called refreshListenable, which receives a…
0
votes
2 answers

Unable to read Query Parameters Using GetPage - Flutter

I'm using GetMaterialApp.router from getx as I have used it to handle navigation in my app, but surprisingly it does not provide the same set of parameters as MaterialApp.router. Nevertheless, I added routes using getPages. I have been trying to…
0
votes
1 answer

Trouble in adding events from a stream to my Bloc and then Redirecting to another route (Authentication process)

So i will provide my code as it is the simplest way of understanding my problem. I started with my UserService class that creates a stream which receives data continuously whenever the AuthStateChanges (from FirebaseAuth) stream triggers enum…
miguel
  • 1
  • 3
0
votes
0 answers

How to redirect to another route without implement build method in `go_router_builder`

I have very simple usecase when user enter the app, I have a route "/" to just redirect it to home if user logged in or-else redirect them to sign in screen. But my implementation works like pushing a route above the "/" route. Here is my…
Definev
  • 21
  • 1
  • 2