redirect property

GoRouterRedirect redirect
final

The top-level callback allows the app to redirect to a new location.

Alternatively, you can specify a redirect for an individual route using GoRoute.redirect. If BuildContext.dependOnInheritedWidgetOfExactType is used during the redirection (which is how of methods are usually implemented), a re-evaluation will be triggered when the InheritedWidget changes.

See GoRouter.

Implementation

final GoRouterRedirect redirect;