DefaultNavigationPlugin constructor
DefaultNavigationPlugin({
- bool urlReflectsImperativeAPIs = false,
- GoRouterRedirect? redirect,
- 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,
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;
}
}