VRouter constructor
VRouter({
- Key? key,
- required List<
VRouteElement> routes, - Future<
void> beforeEnter(- VRedirector vRedirector
- Future<
void> beforeLeave(- VRedirector vRedirector,
- void saveHistoryState()
- void afterEnter(
- BuildContext context,
- String? from,
- String to
- Future<
void> onPop(- VRedirector vRedirector
- Future<
void> onSystemPop(- VRedirector vRedirector
- Widget buildTransition()?,
- Duration? transitionDuration,
- Duration? reverseTransitionDuration,
- VRouterMode mode = VRouterMode.hash,
- String initialUrl = '/',
- List<
VLogLevel> logs = VLogs.info, - Widget builder(
- BuildContext context,
- Widget child
- @Deprecated('Please use navigatorKey instead.\n This has been removed because it is redundant with navigatorKey.') Key? appRouterKey,
- String title = '',
- GenerateAppTitle? onGenerateTitle,
- Color? color,
- ThemeData? theme,
- ThemeData? darkTheme,
- ThemeData? highContrastTheme,
- ThemeData? highContrastDarkTheme,
- ThemeMode? themeMode = ThemeMode.system,
- Locale? locale,
- Iterable<
LocalizationsDelegate> ? localizationsDelegates, - LocaleListResolutionCallback? localeListResolutionCallback,
- LocaleResolutionCallback? localeResolutionCallback,
- Iterable<
Locale> supportedLocales = const <Locale>[Locale('en', 'US')], - bool debugShowMaterialGrid = false,
- bool showPerformanceOverlay = false,
- bool checkerboardRasterCacheImages = false,
- bool checkerboardOffscreenLayers = false,
- bool showSemanticsDebugger = false,
- bool debugShowCheckedModeBanner = true,
- bool useInheritedMediaQuery = false,
- Map<
LogicalKeySet, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - String? restorationScopeId,
- ScrollBehavior? scrollBehavior,
Implementation
VRouter({
Key? key,
required this.routes,
Future<void> Function(VRedirector vRedirector) beforeEnter =
VoidVGuard.voidBeforeEnter,
Future<void> Function(
VRedirector vRedirector,
void Function(Map<String, String> historyState) saveHistoryState,
)
beforeLeave = VoidVGuard.voidBeforeLeave,
void Function(BuildContext context, String? from, String to) afterEnter =
VoidVGuard.voidAfterEnter,
Future<void> Function(VRedirector vRedirector) onPop =
VoidVPopHandler.voidOnPop,
Future<void> Function(VRedirector vRedirector) onSystemPop =
VoidVPopHandler.voidOnSystemPop,
this.buildTransition,
this.transitionDuration,
this.reverseTransitionDuration,
this.mode = VRouterMode.hash,
this.initialUrl = '/',
this.logs = VLogs.info,
this.navigatorObservers = const [],
this.builder,
@Deprecated('Please use navigatorKey instead.\n This has been removed because it is redundant with navigatorKey.')
this.appRouterKey,
this.navigatorKey,
// Bellow are the MaterialApp parameters
this.title = '',
this.onGenerateTitle,
this.color,
this.theme,
this.darkTheme,
this.highContrastTheme,
this.highContrastDarkTheme,
this.themeMode = ThemeMode.system,
this.locale,
this.localizationsDelegates,
this.localeListResolutionCallback,
this.localeResolutionCallback,
this.supportedLocales = const <Locale>[Locale('en', 'US')],
this.debugShowMaterialGrid = false,
this.showPerformanceOverlay = false,
this.checkerboardRasterCacheImages = false,
this.checkerboardOffscreenLayers = false,
this.showSemanticsDebugger = false,
this.debugShowCheckedModeBanner = true,
this.useInheritedMediaQuery = false,
this.shortcuts,
this.actions,
this.restorationScopeId,
this.scrollBehavior,
}) : _beforeEnter = beforeEnter,
_beforeLeave = beforeLeave,
_afterEnter = afterEnter,
_onPop = onPop,
_onSystemPop = onSystemPop,
super(key: key);