Open chris-rutkowski opened 1 year ago
That's a pretty old issue, but du you still face the problem ?
We use the phoenix package on an internal project, while also using the go_router
package, and we didn't encounter any specific behavior issue
I had the same issues and figured out that Phoenix doesn't work with go_router if you are not on the root screen. Anyway, if you do Navigator.of(context).pop(); before restarting with phoenix, I also got an error.
My solution was to add this line before Phoenix.rebirth(context);
context.go('/'); Phoenix.rebirth(context);
Hello, go_router is very popular package, now maintained by the Flutter team.
Unfortunately, Phoenix doesn't work as expected with it, you can verify with the attached source code. Most likely it is not directly related to go_router, but the underlying Navigator 2.0 (with URL for navigation).
I left the print statements to understand what happens when I call the
rebirth
method. The app is rebuilt, stateful Detail page is rebuilt, unfortunately, the state of the Detail page is not recreated. The very same example with imperative navigator works just fine with Phoenix.You can see the journey I see in the console:
I would appreciate your advice on how this could be resolved. I'm using Flutter stable 3.3.5 and confirmed the same issue with the most recent, go_router 6.0.0 (most recent) and flutter_phoenix 1.1.0 (most recent).
Kind regards