VRouter constructor

VRouter({
  1. Key? key,
  2. required List<VRouteElement> routes,
  3. Future<void> beforeEnter(
    1. VRedirector vRedirector
    ) = VoidVGuard.voidBeforeEnter,
  4. Future<void> beforeLeave(
    1. VRedirector vRedirector,
    2. void saveHistoryState(
      1. Map<String, String> historyState
      )
    ) = VoidVGuard.voidBeforeLeave,
  5. void afterEnter(
    1. BuildContext context,
    2. String? from,
    3. String to
    ) = VoidVGuard.voidAfterEnter,
  6. Future<void> onPop(
    1. VRedirector vRedirector
    ) = VoidVPopHandler.voidOnPop,
  7. Future<void> onSystemPop(
    1. VRedirector vRedirector
    ) = VoidVPopHandler.voidOnSystemPop,
  8. Widget buildTransition(
    1. Animation<double> animation,
    2. Animation<double> secondaryAnimation,
    3. Widget child
    )?,
  9. Duration? transitionDuration,
  10. Duration? reverseTransitionDuration,
  11. VRouterMode mode = VRouterMode.hash,
  12. String initialUrl = '/',
  13. List<VLogLevel> logs = VLogs.info,
  14. List<NavigatorObserver> navigatorObservers = const [],
  15. Widget builder(
    1. BuildContext context,
    2. Widget child
    )?,
  16. @Deprecated('Please use navigatorKey instead.\n This has been removed because it is redundant with navigatorKey.') Key? appRouterKey,
  17. GlobalKey<NavigatorState>? navigatorKey,
  18. String title = '',
  19. GenerateAppTitle? onGenerateTitle,
  20. Color? color,
  21. ThemeData? theme,
  22. ThemeData? darkTheme,
  23. ThemeData? highContrastTheme,
  24. ThemeData? highContrastDarkTheme,
  25. ThemeMode? themeMode = ThemeMode.system,
  26. Locale? locale,
  27. Iterable<LocalizationsDelegate>? localizationsDelegates,
  28. LocaleListResolutionCallback? localeListResolutionCallback,
  29. LocaleResolutionCallback? localeResolutionCallback,
  30. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  31. bool debugShowMaterialGrid = false,
  32. bool showPerformanceOverlay = false,
  33. bool checkerboardRasterCacheImages = false,
  34. bool checkerboardOffscreenLayers = false,
  35. bool showSemanticsDebugger = false,
  36. bool debugShowCheckedModeBanner = true,
  37. bool useInheritedMediaQuery = false,
  38. Map<LogicalKeySet, Intent>? shortcuts,
  39. Map<Type, Action<Intent>>? actions,
  40. String? restorationScopeId,
  41. 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);