bizz84 / nested_navigation_examples

Bottom Navigation Bar with Nested Routes: GoRouter vs Beamer
https://codewithandrea.com/
MIT License
108 stars 18 forks source link

"Multiple widgets used the same GlobalKey" #2

Closed rmoralesd closed 1 year ago

rmoralesd commented 2 years ago

In the example using "go_router", the app works as intended, but every time a change is made and a hot reload is triggered, the app crashes with "Multiple widgets used the same GlobalKey" exception.

bizz84 commented 1 year ago

Seems the same issue as this: https://github.com/flutter/flutter/issues/113757

tolo commented 1 year ago

And the underlying issue is this: flutter/flutter#127206, i.e. GoRouter currently doesn't support inline creation of the GoRouter instance - it must be created only once and passed as a variable to MaterialApp.router.

bizz84 commented 1 year ago

@tolo ah yes, that makes sense! Thank you very much for pointing it out!