mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
fix status bar
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
import "dart:ui";
|
||||||
|
|
||||||
import "package:fluent_ui/fluent_ui.dart";
|
import "package:fluent_ui/fluent_ui.dart";
|
||||||
import "package:flutter/services.dart";
|
import "package:flutter/services.dart";
|
||||||
import "package:pixes/appdata.dart";
|
import "package:pixes/appdata.dart";
|
||||||
@@ -47,40 +49,31 @@ class MyApp extends StatelessWidget {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
return StateBuilder<SimpleController>(
|
||||||
value: const SystemUiOverlayStyle(
|
init: SimpleController(),
|
||||||
systemNavigationBarColor: Colors.transparent,
|
tag: "MyApp",
|
||||||
statusBarColor: Colors.transparent),
|
builder: (controller) {
|
||||||
child: StateBuilder<SimpleController>(
|
Brightness brightness = PlatformDispatcher.instance.platformBrightness;
|
||||||
init: SimpleController(),
|
|
||||||
tag: "MyApp",
|
|
||||||
builder: (controller) {
|
|
||||||
Brightness? brightness;
|
|
||||||
|
|
||||||
if(appdata.settings["theme"] == "Dark") {
|
if(appdata.settings["theme"] == "Dark") {
|
||||||
brightness = Brightness.dark;
|
brightness = Brightness.dark;
|
||||||
} else if(appdata.settings["theme"] == "Light") {
|
} else if(appdata.settings["theme"] == "Light") {
|
||||||
brightness = Brightness.light;
|
brightness = Brightness.light;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FluentApp(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
|
value: SystemUiOverlayStyle(
|
||||||
|
systemNavigationBarColor: Colors.transparent,
|
||||||
|
statusBarColor: Colors.transparent,
|
||||||
|
statusBarIconBrightness: brightness.opposite,
|
||||||
|
systemNavigationBarIconBrightness: brightness.opposite,
|
||||||
|
),
|
||||||
|
child: FluentApp(
|
||||||
navigatorKey: App.rootNavigatorKey,
|
navigatorKey: App.rootNavigatorKey,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
title: 'pixes',
|
title: 'pixes',
|
||||||
theme: FluentThemeData(
|
theme: FluentThemeData(
|
||||||
brightness: brightness ?? Brightness.light,
|
brightness: brightness,
|
||||||
fontFamily: App.isWindows ? 'font' : null,
|
|
||||||
accentColor: AccentColor.swatch({
|
|
||||||
'darkest': SystemTheme.accentColor.darkest,
|
|
||||||
'darker': SystemTheme.accentColor.darker,
|
|
||||||
'dark': SystemTheme.accentColor.dark,
|
|
||||||
'normal': SystemTheme.accentColor.accent,
|
|
||||||
'light': SystemTheme.accentColor.light,
|
|
||||||
'lighter': SystemTheme.accentColor.lighter,
|
|
||||||
'lightest': SystemTheme.accentColor.lightest,
|
|
||||||
})),
|
|
||||||
darkTheme: FluentThemeData(
|
|
||||||
brightness: brightness ?? Brightness.dark,
|
|
||||||
fontFamily: App.isWindows ? 'font' : null,
|
fontFamily: App.isWindows ? 'font' : null,
|
||||||
accentColor: AccentColor.swatch({
|
accentColor: AccentColor.swatch({
|
||||||
'darkest': SystemTheme.accentColor.darkest,
|
'darkest': SystemTheme.accentColor.darkest,
|
||||||
@@ -107,8 +100,8 @@ class MyApp extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return OverlayWidget(child);
|
return OverlayWidget(child);
|
||||||
});
|
}),
|
||||||
}),
|
);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user