csells / go_router

The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
https://gorouter.dev
441 stars 96 forks source link

Issue on chrome/android while navigating #350

Closed blamath20 closed 2 years ago

blamath20 commented 2 years ago

I have a large sized app with several routes. It is working fine when packaged as an android app as well as when packaged as web app and accessed from chrome on desktop. However, when the web version is accessed on Chrome on an android device, I am observing a very weird behavior.

In one of the use cases, the app shows an alert box and when the user clicks ok, the alert box is popped (using Navigator) and the app navigates to the home screen using the call to go_router like this:

//onPressed of alert box's OK button:
onPressed: (){ 
  Navigator.of(context).pop(); //removes the alert box
  GoRouter.of(context).goNamed('tab', params: {'tabid':'1'}); //go to the home screen i.e. the first tab
},

The app then shows the home screen (the first tab). Everything this is fine up to this point.

However, immediately after this point, something goes haywire with the go_router. None of the actions that invoke go_router (such as tapping other bottom nav buttons) to change the screen work. I see the messages like "INFO: GoRouter: going to /tab/2" in the console whenever a bottom nav button is clicked. But it doesn't actually go to these routes. The app is neither frozen nor crashed but it just doesn't do any navigation. It does not generate any exception or error message in the console log either.

(BTW, the action associated with FloatingActionButton works because it doesn't use go_router's API. It uses Navigator directly to pop a new screen. )

Again, this happens only on Chrome/Android (not on Chrome/Windows or APK/Android).

I know it is not possible to determine the issue without looking at the code but it is a huge app and I can't really post the code. I am requesting suggestions on how to debug this. What can I do not make it dump more information, which can help me debug.

leoshusar commented 2 years ago

Please create minimal repro, this behavior is working in my app.