navigate method
Updates the navigation stack to the path from target
to the root of the
navigation tree. The target route will receive target
as its value.
All the routes that have been in the stack before will preserve their
values in the new stack. If the new stack contains routes that weren't
present in the old stack (apart from the target route), those routes will
have to rely on their default values. The values
parameter can override
the old values, or provide the values for the new routes.
Returned future completes with the value popped from the target route.
Implementation
@override
Future navigate(RouteValue target, [Set<RouteValue> values = const {}]) {
setStack(createStack(target, values));
return stack.last().popCompleter.future;
}