This repository has been archived by the owner on Feb 25, 2022. It is now read-only.
Replies: 1 comment
-
Good pro tips. Thank you! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is a lesson learned that I would like to share in case someone else faces the same issue 😅
issue:
Whenever I hot reload my app or save a file, the app navigates back to the initial route (i.e.
/
).Cause:
After migrating to
go_router
, the top widget of my app was an AuthProvider widget so my App looked something like this:Solution:
To fix the issue, there are two approaches:
RootApp
to aStatefulWidget
and the issue will be gone.RootApp
to the top and useGoRouter.navigatorBuilder
to wrap any providers that need to be on top of the navigator.Beta Was this translation helpful? Give feedback.
All reactions