DefaultNavigationPlugin constructor
DefaultNavigationPlugin({
- bool urlReflectsImperativeAPIs = false,
- GoRouterRedirect? redirect,
- int maxRetainedBranches = defaultMaxRetainedBranches,
- OnEnter? onEnter,
- int redirectLimit = 5,
- Listenable? refreshListenable,
- GoExceptionHandler? onException,
- GoRouterWidgetBuilder? errorBuilder,
- GoRouterPageBuilder? errorPageBuilder,
- Codec<
Object?, Object?> ? extraCodec, - String? restorationScopeId,
- bool requestFocus = true,
- bool routerNeglect = false,
- bool overridePlatformDefaultLocation = false,
- RouterUrlStyle? urlStyle,
Creates the GoRouter-based navigation plugin.
redirect: a global redirect, run before every feature redirect.urlStyle: hash or path URLs on the web. Applied immediately, so create the plugin beforerunApp.urlReflectsImperativeAPIs: whetherpushand friends update the browser URL.
Implementation
DefaultNavigationPlugin({
final bool urlReflectsImperativeAPIs = false,
this.redirect,
super.maxRetainedBranches,
this.onEnter,
this.redirectLimit = 5,
this.refreshListenable,
this.onException,
this.errorBuilder,
this.errorPageBuilder,
this.extraCodec,
this.restorationScopeId,
this.requestFocus = true,
this.routerNeglect = false,
this.overridePlatformDefaultLocation = false,
RouterUrlStyle? urlStyle,
}) : super(
name: 'vyuh.plugin.navigation.default',
title: 'Default Navigation Plugin (GoRouter)',
) {
if (urlReflectsImperativeAPIs) {
enableURLReflectsImperativeAPIs();
}
switch (urlStyle) {
case RouterUrlStyle.path:
usePathStrategy();
case RouterUrlStyle.hash:
useHashStrategy();
case null:
break;
}
}