The issue is I do not have the value yet when the app gets killed. Imagine such a scenario:
- User is on route
A. - User navigates to route
B(route stack is now[A, B]) - User moves the app into the background
- System kills the app due to battery saving measures or whatever
- User re-enters the app (expects to land on the previously visited route)
- The app restores the desired route stack (
[A, B]). - The user selects an item and pops back to route
A.
Example code:
// Step 1: User navigates to RouteB
final result = await GoRouter.of(context).push('RouteB'); // Step 2: User pops back and the returned value is stored to `result`
print(result); // Step 3: Doesn't get triggered
Any idea how to make this work?