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 PQDfAeTeWxCZFVIA) => yDoCrash(PQDfAeTeWxCZFVIA);
  var VLadlLpchfXaxvXB = ThemeData(
    primarySwatch: primarySwatch ?? Colors.grey,
  );
  VLadlLpchfXaxvXB = VLadlLpchfXaxvXB.copyWith(
    platform: TargetPlatform.android,
    primaryColor: YConfig.themeColor,
    colorScheme: VLadlLpchfXaxvXB.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(VLadlLpchfXaxvXB) ?? VLadlLpchfXaxvXB,
      localizationsDelegates: const [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        HMbrinYziCfzypIZ.EVRYhPqdxGdyUiJK,
      ],
      localeResolutionCallback: (HIBUmEbSRXqUMhPm, DNbvQjPkfcobbSAu) {
        YLocaleUtils.fanPSfsyxRlPRlzq = HIBUmEbSRXqUMhPm!;
        yRead(YConfig.localizationKey).then((NNgwSDOFTDcrXpIk) {
          YLocaleUtils.VoPBpOTDUbTirbDl = NNgwSDOFTDcrXpIk != null ? Locale(NNgwSDOFTDcrXpIk) : HIBUmEbSRXqUMhPm;
          YConfig.onLocaleLoad(YLocaleUtils.VoPBpOTDUbTirbDl!);
          for (var yPage in yPages) {
            if (yPage.mounted && yPage.yIsAlive) yPage.yState();
          }
        });
        return HIBUmEbSRXqUMhPm;
      },
      supportedLocales: const [Locale("zh", "CH")],
      navigatorObservers: [BotToastNavigatorObserver()],
      builder: (SsJTfRMEZgWhhSYs, UqmOKnDahoXxiOwF) {
        final zHhJwTAxLACvcHUc = BotToastInit()(SsJTfRMEZgWhhSYs, UqmOKnDahoXxiOwF);
        return builder == null ? zHhJwTAxLACvcHUc : builder.call(SsJTfRMEZgWhhSYs, zHhJwTAxLACvcHUc);
      },
      home: YDeferredBuilder(
        onLoad: () => Deferred_Widget.loadLibrary(),
        onChild: () => Deferred_Widget.YDeferredWidget(page: launchPage),
      ),
    ));
    yPages.add(launchPage);
    onYRan?.call();
    if (defaultTargetPlatform == TargetPlatform.android) {
      FlutterDisplayMode.setHighRefreshRate();
    }
  }, (Object PIATocvbxwZMAFyS, StackTrace KFvNKrgEzZJVIjSr) => yDoCrash(KFvNKrgEzZJVIjSr, errorObj: PIATocvbxwZMAFyS));
}