yRunApp function
void
yRunApp({
- required YPage launchPage,
- MaterialColor? primarySwatch,
- required dynamic onYConfig(),
- dynamic builder(
- BuildContext context,
- Widget? child
- ThemeData theme(
- ThemeData yThemeData
- 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 rezMMXEblWdNQNqL) => yDoCrash(rezMMXEblWdNQNqL);
var qUNexCrcrifJWDKS = ThemeData(
primarySwatch: primarySwatch ?? Colors.grey,
);
qUNexCrcrifJWDKS = qUNexCrcrifJWDKS.copyWith(
platform: TargetPlatform.android,
primaryColor: YConfig.themeColor,
colorScheme: qUNexCrcrifJWDKS.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(qUNexCrcrifJWDKS) ?? qUNexCrcrifJWDKS,
localizationsDelegates: const [
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
VzXqeXeOTWukYnCK.iQgiIjLCYoBsRkBW,
],
localeResolutionCallback: (fPZKGRgyKIzHxwcU, LmzkZXajeKhCvqBc) {
YLocaleUtils.cgslIheBcImgicKT = fPZKGRgyKIzHxwcU!;
yRead(YConfig.localizationKey).then((tmHtgGUjaKxZyJZF) {
YLocaleUtils.QrtJmnfCSZYMYImK = tmHtgGUjaKxZyJZF != null ? Locale(tmHtgGUjaKxZyJZF) : fPZKGRgyKIzHxwcU;
YConfig.onLocaleLoad(YLocaleUtils.QrtJmnfCSZYMYImK!);
for (var yPage in yPages) {
if (yPage.mounted && yPage.yIsAlive) yPage.yState();
}
});
return fPZKGRgyKIzHxwcU;
},
supportedLocales: const [Locale("zh", "CH")],
navigatorObservers: [BotToastNavigatorObserver()],
builder: (ywktHUOTPCbHpqbc, FeVMlGQiLzyMjLmH) {
final lmhGjXzrGebopgNH = BotToastInit()(ywktHUOTPCbHpqbc, FeVMlGQiLzyMjLmH);
return builder == null ? lmhGjXzrGebopgNH : builder.call(ywktHUOTPCbHpqbc, lmhGjXzrGebopgNH);
},
home: YDeferredBuilder(
onLoad: () => Deferred_Widget.loadLibrary(),
onChild: () => Deferred_Widget.YDeferredWidget(page: launchPage),
),
));
yPages.add(launchPage);
onYRan?.call();
if (defaultTargetPlatform == TargetPlatform.android) {
FlutterDisplayMode.setHighRefreshRate();
}
}, (Object QvdQrDYctoNAcKWs, StackTrace kzBGbitdXHmFykzJ) => yDoCrash(kzBGbitdXHmFykzJ, errorObj: QvdQrDYctoNAcKWs));
}