pushAndWait<T> method

Future<T> pushAndWait<T>(
  1. ValueRoute<T> route
)

Puts route on top of the stack and waits until that route is popped.

More precisely, this method returns a future that can be awaited until the route is popped; the value returned by this future is generated by the route as the "return value". This can be useful for creating dialog boxes that take user input and then return it to the user.

Implementation

Future<T> pushAndWait<T>(ValueRoute<T> route) {
  pushRoute(route);
  return route.future;
}