KiteApp constructor

const KiteApp({
  1. Key? key,
  2. GlobalKey<NavigatorState>? navigatorKey,
  3. GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
  4. Widget? home,
  5. Map<String, WidgetBuilder> routes = const <String, WidgetBuilder>{},
  6. String? initialRoute,
  7. RouteFactory? onGenerateRoute,
  8. InitialRouteListFactory? onGenerateInitialRoutes,
  9. RouteFactory? onUnknownRoute,
  10. List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
  11. PageRouteFactory? pageRouteBuilder,
  12. TransitionBuilder? builder,
  13. String title = '',
  14. GenerateAppTitle? onGenerateTitle,
  15. NotificationListenerCallback<NavigationNotification>? onNavigationNotification,
  16. Color? color,
  17. ThemeData? theme,
  18. ThemeData? darkTheme,
  19. ThemeMode themeMode = ThemeMode.system,
  20. Duration themeAnimationDuration = kThemeAnimationDuration,
  21. Curve themeAnimationCurve = Curves.linear,
  22. Locale? locale,
  23. Iterable<LocalizationsDelegate>? localizationsDelegates,
  24. LocaleListResolutionCallback? localeListResolutionCallback,
  25. LocaleResolutionCallback? localeResolutionCallback,
  26. Iterable<Locale> supportedLocales = const <Locale>[Locale('en', 'US')],
  27. bool showPerformanceOverlay = false,
  28. bool showSemanticsDebugger = false,
  29. bool debugShowCheckedModeBanner = true,
  30. bool debugGrid = false,
  31. bool debugShowKiteBanner = false,
  32. Map<ShortcutActivator, Intent>? shortcuts,
  33. Map<Type, Action<Intent>>? actions,
  34. String? restorationScopeId,
  35. ScrollBehavior scrollBehavior = const MaterialScrollBehavior(),
})

Creates a classic Navigator-based Kite application.

Similar usage to MaterialApp:

KiteApp(
  home: const HomePage(),
)

Implementation

const KiteApp({
  super.key,
  this.navigatorKey,
  this.scaffoldMessengerKey,
  this.home,
  this.routes = const <String, WidgetBuilder>{},
  this.initialRoute,
  this.onGenerateRoute,
  this.onGenerateInitialRoutes,
  this.onUnknownRoute,
  this.navigatorObservers = const <NavigatorObserver>[],
  this.pageRouteBuilder,
  this.builder,
  this.title = '',
  this.onGenerateTitle,
  this.onNavigationNotification,
  this.color,
  this.theme,
  this.darkTheme,
  this.themeMode = ThemeMode.system,
  this.themeAnimationDuration = kThemeAnimationDuration,
  this.themeAnimationCurve = Curves.linear,
  this.locale,
  this.localizationsDelegates,
  this.localeListResolutionCallback,
  this.localeResolutionCallback,
  this.supportedLocales = const <Locale>[Locale('en', 'US')],
  this.showPerformanceOverlay = false,
  this.showSemanticsDebugger = false,
  this.debugShowCheckedModeBanner = true,
  this.debugGrid = false,
  this.debugShowKiteBanner = false,
  this.shortcuts,
  this.actions,
  this.restorationScopeId,
  this.scrollBehavior = const MaterialScrollBehavior(),
}) : assert(
       home != null ||
           onGenerateRoute != null ||
           onUnknownRoute != null ||
           builder != null,
       'KiteApp requires home, routes, onGenerateRoute, '
       'onUnknownRoute, or builder.',
     ),
     routerConfig = null,
     _type = _KiteAppType.navigator;