SchabanBo / qlevar_router

Manage you project Routes. Create nested routes. Simply navigation without context to your pages. Change only one sub widget in your page when navigating to new route.
MIT License
86 stars 22 forks source link

Returning result from a page after state restoration #149

Open BarashkovaElena opened 1 month ago

BarashkovaElena commented 1 month ago

qlevar_router allows to return the result from a page this way: final result = await QR.to<String>('/page', waitForResult: true);

This works fine until we want to support state restoration on android. Consider the following steps:

  1. Configure the app with qlevar_router with state restoration enabled.
  2. Enable "don't keep activities" flag on Android device.
  3. Start the app and open a page with waitForResult = true
  4. Put the app to background, causing it to be killed by the system.
  5. Go back to the app, so that its state and route is restored.
  6. Close the currently opened page by calling QR.back('result')

The caller page will not receive this result.

I haven't found a way to pass result in a way that survives state restoration. Would be helpful to have this option.