toMaterialApp method
MaterialApp
toMaterialApp({
- Key? key,
- GlobalKey<
ScaffoldMessengerState> ? scaffoldMessengerKey, - Widget? home,
- String initialRoute = "/",
- Widget builder(
- BuildContext context,
- Widget? widget
- String title = '',
- String onGenerateTitle(
- BuildContext context
- Color? color,
- ThemeData? theme,
- ThemeData? darkTheme,
- ThemeData? highContrastTheme,
- ThemeData? highContrastDarkTheme,
- ThemeMode? themeMode = ThemeMode.system,
- Duration themeAnimationDuration = kThemeAnimationDuration,
- Curve themeAnimationCurve = Curves.linear,
- Locale? locale,
- Iterable<
LocalizationsDelegate> ? localizationsDelegates, - Locale? localeListResolutionCallback()?,
- Locale? 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,
- Map<
ShortcutActivator, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - String? restorationScopeId,
- ScrollBehavior? scrollBehavior,
- bool useInheritedMediaQuery = false,
- AnimationStyle? themeAnimationStyle,
Implementation
MaterialApp toMaterialApp({
Key? key,
GlobalKey<NavigatorState>? navigatorKey,
GlobalKey<ScaffoldMessengerState>? scaffoldMessengerKey,
Widget? home,
String initialRoute = "/",
bool Function(NavigationNotification navigationNotification)? onNavigationNotification,
List<NavigatorObserver> navigatorObservers = const <NavigatorObserver>[],
Widget Function(BuildContext context, Widget? widget)? builder,
String title = '',
String Function(BuildContext context)? onGenerateTitle,
Color? color,
ThemeData? theme,
ThemeData? darkTheme,
ThemeData? highContrastTheme,
ThemeData? highContrastDarkTheme,
ThemeMode? themeMode = ThemeMode.system,
Duration themeAnimationDuration = kThemeAnimationDuration,
Curve themeAnimationCurve = Curves.linear,
Locale? locale,
Iterable<LocalizationsDelegate<dynamic>>? localizationsDelegates,
Locale? Function(List<Locale>? locales, Iterable<Locale> supportedLocales)? localeListResolutionCallback,
Locale? Function(Locale? locale, Iterable<Locale> supportedLocales)? 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,
Map<ShortcutActivator, Intent>? shortcuts,
Map<Type, Action<Intent>>? actions,
String? restorationScopeId,
ScrollBehavior? scrollBehavior,
bool useInheritedMediaQuery = false,
AnimationStyle? themeAnimationStyle,
}) {
return MaterialApp(
routes: toRoutes(),
initialRoute: initialRoute,
onGenerateInitialRoutes: toOnGenerateInitialRoutes,
onUnknownRoute: toOnUnknownRoute,
onGenerateRoute: toOnGenerateRoute,
key: key,
navigatorKey: navigatorKey,
scaffoldMessengerKey: scaffoldMessengerKey,
actions: actions,
// ignore: deprecated_member_use
useInheritedMediaQuery: useInheritedMediaQuery,
restorationScopeId: restorationScopeId,
localeResolutionCallback: localeResolutionCallback,
localeListResolutionCallback: localeListResolutionCallback,
checkerboardRasterCacheImages: checkerboardRasterCacheImages,
theme: theme,
themeAnimationCurve: themeAnimationCurve,
themeAnimationDuration: themeAnimationDuration,
themeAnimationStyle: themeAnimationStyle,
themeMode: themeMode,
title: title,
onGenerateTitle: onGenerateTitle,
onNavigationNotification: onNavigationNotification,
navigatorObservers: navigatorObservers,
checkerboardOffscreenLayers: checkerboardOffscreenLayers,
showPerformanceOverlay: showPerformanceOverlay,
scrollBehavior: scrollBehavior,
shortcuts: shortcuts,
showSemanticsDebugger: showSemanticsDebugger,
supportedLocales: supportedLocales,
darkTheme: darkTheme,
debugShowCheckedModeBanner: debugShowCheckedModeBanner,
debugShowMaterialGrid: debugShowMaterialGrid,
highContrastDarkTheme: highContrastDarkTheme,
localizationsDelegates: localizationsDelegates,
highContrastTheme: highContrastTheme,
home: home,
locale: locale,
color: color,
builder: builder,
);
}