RouteDefiner<T>.redirect constructor
Runs preceding guards, then redirects through the normal guard pipeline. Redirect destinations are locations, with the usual cancellation, timeout, retry and loop limits. Arguments are not forwarded to the destination.
Implementation
RouteDefiner.redirect({
required String path,
required FutureOr<String> Function(RouteState) redirect,
List<RouteGuard> guards = const [],
Map<String, Object>? data,
}) : this(
path: path,
builder: (_, __) => const SizedBox.shrink(),
data: data,
guards: [
...guards,
(route) async =>
RouteDecision.redirect(await redirect(route.state))
]);