run method
void
run(
- Widget? home, {
- TransitionBuilder? builder,
- ScrollBehavior? scrollBehavior,
- Color? color,
- Map<
ShortcutActivator, Intent> ? shortcuts, - Map<
Type, Action< ? actions,Intent> > - String? restorationScopeId,
- AnimationStyle? themeAnimationStyle,
Implementation
void run(
Widget? home, {
TransitionBuilder? builder,
ScrollBehavior? scrollBehavior,
Color? color,
Map<ShortcutActivator, Intent>? shortcuts,
Map<Type, Action<Intent>>? actions,
String? restorationScopeId,
AnimationStyle? themeAnimationStyle,
}) {
ThemeWidget themeWidget = ThemeWidget((context) {
return MaterialApp(
onGenerateTitle: onGenerateTitle ?? (c) => title,
themeMode: themeMode,
theme: themeDataLight,
darkTheme: themeDataDark,
locale: locale,
supportedLocales: supportedLocales ?? [Locale("zh")],
localizationsDelegates: [?localDelegate, GlobalMaterialLocalizations.delegate, GlobalWidgetsLocalizations.delegate, GlobalCupertinoLocalizations.delegate],
debugShowCheckedModeBanner: false,
navigatorKey: globalKey,
home: home,
builder: builder ?? appBuilder,
scrollBehavior: scrollBehavior,
color: color,
shortcuts: shortcuts,
actions: actions,
restorationScopeId: restorationScopeId,
themeAnimationStyle: themeAnimationStyle,
);
});
runApp(themeWidget);
}