yRunApp function

void yRunApp({
  1. required YPage launchPage,
  2. MaterialColor? primarySwatch,
  3. required dynamic onYConfig(),
  4. dynamic builder(
    1. BuildContext context,
    2. Widget? child
    )?,
  5. ThemeData theme(
    1. ThemeData yThemeData
    )?,
  6. dynamic onYRan()?,
})

Implementation

void yRunApp({
  required YPage launchPage,
  MaterialColor? primarySwatch,
  required Function() onYConfig,
  Function(BuildContext context, Widget? child)? builder,
  ThemeData Function(ThemeData yThemeData)? theme,
  Function()? onYRan,
}) {
  onYConfig();
  FlutterError.onError = (FlutterErrorDetails YAjtMCoAMZYsuOGB) => yDoCrash(YAjtMCoAMZYsuOGB);
  var roKskVTehGzGtXtZ = ThemeData(
    primarySwatch: primarySwatch ?? Colors.grey,
  );
  roKskVTehGzGtXtZ = roKskVTehGzGtXtZ.copyWith(
    platform: TargetPlatform.android,
    primaryColor: YConfig.themeColor,
    colorScheme: roKskVTehGzGtXtZ.colorScheme.copyWith(secondary: YConfig.themeColor),
    dividerTheme: const DividerThemeData(
      thickness: 1,
      color: Color.fromARGB(255, 248, 248, 248),
      space: 1,
    ),
  );
  runZonedGuarded(() async {
    runApp(MaterialApp(
      title: YConfig.appName,
      debugShowCheckedModeBanner: YConfig.DEBUG,
      theme: theme?.call(roKskVTehGzGtXtZ) ?? roKskVTehGzGtXtZ,
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        vxdGvOJyNBUhrrBZ.MyXnFVSeYQKaqcrF,
      ],
      localeResolutionCallback: (FQdeWEUFVdGcxhoS, DuRtagOjJWQBaHSh) {
        YLocaleUtils.jcystaLKifTfthCE = FQdeWEUFVdGcxhoS!;
        yRead(YConfig.localizationKey).then((qpemFTBwjuwedfhR) {
          YLocaleUtils.LVXwuKSBJPtcmKfy = qpemFTBwjuwedfhR != null ? Locale(qpemFTBwjuwedfhR) : FQdeWEUFVdGcxhoS;
          YConfig.onLocaleLoad(YLocaleUtils.LVXwuKSBJPtcmKfy!);
          for (var yPage in yPages) {
            if (yPage.mounted && yPage.yIsAlive) yPage.yState();
          }
        });
        return FQdeWEUFVdGcxhoS;
      },
      supportedLocales: const [Locale("zh", "CH")],
      navigatorObservers: [BotToastNavigatorObserver()],
      builder: (CPOyqjjKqxKuBVtj, RskeFOzewAPKTkSX) {
        final miwvQTexBsRwJjwM = BotToastInit()(CPOyqjjKqxKuBVtj, RskeFOzewAPKTkSX);
        return builder == null ? miwvQTexBsRwJjwM : builder.call(CPOyqjjKqxKuBVtj, miwvQTexBsRwJjwM);
      },
      home: YDeferredBuilder(
        onLoad: () => Deferred_Widget.loadLibrary(),
        onChild: () => Deferred_Widget.YDeferredWidget(page: launchPage),
      ),
    ));
    yPages.add(launchPage);
    onYRan?.call();
    if (defaultTargetPlatform == TargetPlatform.android) {
      FlutterDisplayMode.setHighRefreshRate();
    }
  }, (Object XWTgZvTtDjWriDFC, StackTrace eDWzLlHaoFeDofnU) => yDoCrash(eDWzLlHaoFeDofnU, obj: XWTgZvTtDjWriDFC));
}