September 2019
Beginner
512 pages
12h 52m
English
When a route is pushed to the navigation, we may want to expect something back from it— for example, when we ask for something from the user in a new route, we can take the value returned via the pop() method's result parameter.
The push method and its variants return a Future. The Future resolves when the route is popped and the value of Future is the pop() method's result parameter.
We have seen that we can pass arguments to a new Route. As the inverse path is also possible, instead of sending a message to the second screen, we can take a message when it pops back.
In Screen 2, we just make sure to return something when doing the pop from Navigator:
// part of navigation_widgetsapp_navigation_result.dart
Read now
Unlock full access