redirectDelegate method

FutureOr<RouteDecoder?> redirectDelegate(
  1. RouteDecoder route
)
inherited

Similar to redirect, This function will be called when the router delegate changes the current route.

The default implmentation is to navigate to the input route, with no redirection.

if this returns null, the navigation is stopped, and no new router are pushed. {@tool snippet}

GetNavConfig? redirect(GetNavConfig route) {
  final authService = Get.find<AuthService>();
  return authService.authed.value ? null : RouteSettings(name: '/login');
}

{@end-tool}

Implementation

FutureOr<RouteDecoder?> redirectDelegate(RouteDecoder route) => (route);