change bottom status bar color

This commit is contained in:
DASHU
2025-01-19 21:52:20 +08:00
parent 19c929dc0a
commit a3407ba841
2 changed files with 16 additions and 16 deletions

View File

@@ -95,6 +95,13 @@ Future<void> main() async {
databaseFactory = databaseFactoryFfi; databaseFactory = databaseFactoryFfi;
} }
try {
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom]);
} catch (e) {
print(e);
}
await doInit(); await doInit();
mediaDataCache = MediaDataCache(); mediaDataCache = MediaDataCache();
@@ -162,6 +169,10 @@ class _MyApp extends State<MyApp> {
RouterPath.AUTH_LOGS: (context) => AuthLogsRouter(), RouterPath.AUTH_LOGS: (context) => AuthLogsRouter(),
}; };
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: lightTheme.scaffoldBackgroundColor,
));
return MultiProvider( return MultiProvider(
providers: [ providers: [
ListenableProvider<WebProvider>.value( ListenableProvider<WebProvider>.value(

View File

@@ -119,24 +119,13 @@ class _IndexRouter extends CustState<IndexRouter>
}, },
child: Scaffold( child: Scaffold(
key: _scaffoldKey, key: _scaffoldKey,
body: AnnotatedRegion<SystemUiOverlayStyle>( body: Column(
value: SystemUiOverlayStyle.light.copyWith(
statusBarColor: themeData.scaffoldBackgroundColor,
systemNavigationBarIconBrightness: Brightness.dark,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
),
child: SafeArea(
bottom: true,
child: Column(
children: [ children: [
Expanded(child: main), Expanded(child: main),
IndexWebBottomComponent(showControl), IndexWebBottomComponent(showControl),
], ],
), ),
), ),
),
),
); );
} }