qlevar_router
qlevar_router copied to clipboard
Returning result from a page after state restoration
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:
- Configure the app with qlevar_router with state restoration enabled.
- Enable "don't keep activities" flag on Android device.
- Start the app and open a page with waitForResult = true
- Put the app to background, causing it to be killed by the system.
- Go back to the app, so that its state and route is restored.
- 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.