run method

void run(
  1. Widget? home, {
  2. TransitionBuilder? builder,
  3. ScrollBehavior? scrollBehavior,
  4. Color? color,
  5. Map<ShortcutActivator, Intent>? shortcuts,
  6. Map<Type, Action<Intent>>? actions,
  7. String? restorationScopeId,
  8. 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);
}