TUIApp.router constructor

TUIApp.router({
  1. Key? key,
  2. required TUIThemeData theme,
  3. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  4. TUIThemeData? darkTheme,
  5. ThemeMode? themeMode,
  6. RouteInformationProvider? routeInformationProvider,
  7. RouteInformationParser<Object>? routeInformationParser,
  8. RouterDelegate<Object>? routerDelegate,
  9. BackButtonDispatcher? backButtonDispatcher,
  10. RouterConfig<Object>? routerConfig,
  11. TransitionBuilder? builder,
  12. String title = '',
  13. GenerateAppTitle? onGenerateTitle,
  14. Locale? locale,
  15. Iterable<LocalizationsDelegate>? localizationsDelegates,
  16. LocaleListResolutionCallback? localeListResolutionCallback,
  17. LocaleResolutionCallback? localeResolutionCallback,
  18. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  19. bool showPerformanceOverlay = false,
  20. bool checkerboardRasterCacheImages = false,
  21. bool checkerboardOffscreenLayers = false,
  22. bool showSemanticsDebugger = false,
  23. bool debugShowCheckedModeBanner = true,
  24. Map<ShortcutActivator, Intent>? shortcuts,
  25. Map<Type, Action<Intent>>? actions,
  26. String? restorationScopeId,
})

Creates a TUIApp that uses the Router instead of a Navigator.

Implementation

TUIApp.router({
  super.key,
  required this.theme,
  this.scaffoldMessengerKey,
  this.darkTheme,
  this.themeMode,
  this.routeInformationProvider,
  this.routeInformationParser,
  this.routerDelegate,
  this.backButtonDispatcher,
  this.routerConfig,
  this.builder,
  this.title = '',
  this.onGenerateTitle,
  this.locale,
  this.localizationsDelegates,
  this.localeListResolutionCallback,
  this.localeResolutionCallback,
  this.supportedLocales = const <Locale>[Locale('en', 'US')],
  this.showPerformanceOverlay = false,
  this.checkerboardRasterCacheImages = false,
  this.checkerboardOffscreenLayers = false,
  this.showSemanticsDebugger = false,
  this.debugShowCheckedModeBanner = true,
  this.shortcuts,
  this.actions,
  this.restorationScopeId,
})  : assert(() {
        if (routerConfig != null) {
          assert(
            (routeInformationProvider ??
                    routeInformationParser ??
                    routerDelegate ??
                    backButtonDispatcher) ==
                null,
            'If the routerConfig is provided, all the other router delegates must not be provided',
          );
          return true;
        }
        assert(routerDelegate != null,
            'Either one of routerDelegate or routerConfig must be provided');
        assert(
          routeInformationProvider == null || routeInformationParser != null,
          'If routeInformationProvider is provided, routeInformationParser must also be provided',
        );
        return true;
      }()),
      navigatorObservers = null,
      navigatorKey = null,
      onGenerateRoute = null,
      home = null,
      onGenerateInitialRoutes = null,
      onUnknownRoute = null,
      routes = null,
      initialRoute = null;