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 97 forks source link

Persist router stack when activity is killed by android os #323

Closed Lingareddyvinitha closed 2 years ago

Lingareddyvinitha commented 2 years ago

I am currently facing the issue, that (if RAM is low etc.) Android may kill the Flutter Activity. I can persist the state of my widgets etc. with no problem, but the current route history always is lost and the app starts again at the initial route.

Is there some way to persist the current stack of the router?

csells commented 2 years ago

go_router supports state restoration. Here's an example that shows off how that works: https://github.com/csells/go_router/blob/main/go_router/example/lib/state_restoration.dart