canDeactivate method

Future<bool> canDeactivate(
  1. RouteLocation to,
  2. RouteLocation from
)

Called before navigating AWAY from a route.

Return true to allow leaving, false to block. Use for "unsaved changes" confirmation dialogs.

Implementation

Future<bool> canDeactivate(
  RouteLocation to,
  RouteLocation from,
) async =>
    true;