Reputation: 1803
I recently added web as a platform on my mobile flutter app. Updated all my navigation code to use GoRouter package.
We cannot use await
on context.go
and I don't want to use context.push
as the url is not deep linkable.
When I press back button on browser or use context.pop
, I want my previous screen to reload fresh just like any webpage would load. but I am not able to figure this out.
Please advice. Thanks in advance.
P.S I am not using any state management package rn. Do I have to implement a package like Riverpod to achieve this?
Upvotes: 0
Views: 45
Reputation: 11
Normally the context.pop
will persist the previous state in the navigation tree. If you just want to start over a new fresh page, please consider using context.go('previous_page')
instead of context.pop
Please check this document out for more details: https://codewithandrea.com/articles/flutter-navigation-gorouter-go-vs-push/
Upvotes: 0