Defines route lifecycle method
routerCanDeactivate, which is called by
the router to determine if a component can be removed as part of a
routerCanDeactivate hook is called with two ComponentInstructions
as parameters, the first representing the current route being navigated to,
and the second parameter representing the previous route.
routerCanDeactivate returns or resolves to
false, the navigation is
cancelled. If it returns or resolves to
true, then the navigation
continues, and the component will be deactivated (the OnDeactivate hook
will be run) and removed.
routerCanDeactivate throws or rejects, the navigation is also
@override FutureOr<bool> routerCanDeactivate(next, prev) => crisis == null || crisis.name == name ? true as FutureOr<bool> : _dialogService.confirm('Discard changes?');
See the router documentation for details.
ComponentInstruction nextInstruction, ComponentInstruction prevInstruction) → dynamic
Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
) → String
Returns a string representation of this object.