feat: apply dark theme

This commit is contained in:
Rongjian Zhang 2022-09-25 02:09:46 +08:00
parent 073af6f492
commit fee559ba9a
1 changed files with 25 additions and 12 deletions

View File

@ -48,19 +48,32 @@ class MyApp extends StatelessWidget {
return supportedLocales.firstWhere((l) => l.languageCode == 'en'); return supportedLocales.firstWhere((l) => l.languageCode == 'en');
}; };
return Container( return AntTheme(
key: auth.rootKey, key: auth.rootKey,
child: CupertinoApp.router( data: AntThemeData(brightness: theme.brightness),
routeInformationProvider: router.routeInformationProvider, child: Builder(
routeInformationParser: router.routeInformationParser, builder: (context) {
routerDelegate: router.routerDelegate, final antTheme = AntTheme.of(context);
theme: CupertinoThemeData(
brightness: theme.brightness, return CupertinoApp.router(
primaryColor: AntTheme.of(context).colorPrimary, routeInformationProvider: router.routeInformationProvider,
), routeInformationParser: router.routeInformationParser,
localizationsDelegates: AppLocalizations.localizationsDelegates, routerDelegate: router.routerDelegate,
supportedLocales: AppLocalizations.supportedLocales, theme: CupertinoThemeData(
localeListResolutionCallback: localeListResolutionCallback, brightness: theme.brightness,
primaryColor: antTheme.colorPrimary,
textTheme: CupertinoTextThemeData(
textStyle: TextStyle(
fontSize: antTheme.fontSizeMain,
color: antTheme.colorText,
),
),
),
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
localeListResolutionCallback: localeListResolutionCallback,
);
},
), ),
); );
} }