TUIApp constructor

const TUIApp({
  1. Key? key,
  2. GlobalKey<NavigatorState>? navigatorKey,
  3. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  4. RouteFactory? onGenerateRoute,
  5. InitialRouteListFactory? onGenerateInitialRoutes,
  6. RouteFactory? onUnknownRoute,
  7. List<NavigatorObserver>? navigatorObservers = const <NavigatorObserver>[],
  8. String? initialRoute,
  9. Widget? home,
  10. Map<String, WidgetBuilder>? routes = const <String, WidgetBuilder>{},
  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. required TUIThemeData theme,
  27. TUIThemeData? darkTheme,
  28. ThemeMode? themeMode,
  29. String? restorationScopeId,
})

Creates a TUIApp.

At least one of home, routes, onGenerateRoute, or builder must be non-null. If only routes is given, it must include an entry for the Navigator.defaultRouteName (/), since that is the route used when the application is launched with an intent that specifies an otherwise unsupported route.

This class creates an instance of WidgetsApp.

The boolean arguments, routes, and navigatorObservers, must not be null.

Implementation

const TUIApp({
  super.key,
  this.navigatorKey,
  this.scaffoldMessengerKey,
  this.onGenerateRoute,
  this.onGenerateInitialRoutes,
  this.onUnknownRoute,
  this.navigatorObservers = const <NavigatorObserver>[],
  this.initialRoute,
  this.home,
  this.routes = const <String, WidgetBuilder>{},
  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,
  required this.theme,
  this.darkTheme,
  this.themeMode,
  this.restorationScopeId,
})  : routeInformationProvider = null,
      routeInformationParser = null,
      routerDelegate = null,
      backButtonDispatcher = null,
      routerConfig = null;