refact: web ui (#9217)

* refact: web ui

Signed-off-by: fufesou <linlong1266@gmail.com>

* refact: remove AppBar shadow

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-09-01 00:30:07 +08:00 committed by GitHub
parent bf390611ab
commit ae339f039d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 188 additions and 126 deletions

View file

@ -350,6 +350,9 @@ class MyTheme {
hoverColor: Color.fromARGB(255, 224, 224, 224),
scaffoldBackgroundColor: Colors.white,
dialogBackgroundColor: Colors.white,
appBarTheme: AppBarTheme(
shadowColor: Colors.transparent,
),
dialogTheme: DialogTheme(
elevation: 15,
shape: RoundedRectangleBorder(
@ -445,6 +448,9 @@ class MyTheme {
hoverColor: Color.fromARGB(255, 45, 46, 53),
scaffoldBackgroundColor: Color(0xFF18191E),
dialogBackgroundColor: Color(0xFF18191E),
appBarTheme: AppBarTheme(
shadowColor: Colors.transparent,
),
dialogTheme: DialogTheme(
elevation: 15,
shape: RoundedRectangleBorder(
@ -550,7 +556,7 @@ class MyTheme {
static void changeDarkMode(ThemeMode mode) async {
Get.changeThemeMode(mode);
if (desktopType == DesktopType.main || isAndroid || isIOS) {
if (desktopType == DesktopType.main || isAndroid || isIOS || isWeb) {
if (mode == ThemeMode.system) {
await bind.mainSetLocalOption(
key: kCommConfKeyTheme, value: defaultOptionTheme);
@ -558,7 +564,7 @@ class MyTheme {
await bind.mainSetLocalOption(
key: kCommConfKeyTheme, value: mode.toShortString());
}
await bind.mainChangeTheme(dark: mode.toShortString());
if (!isWeb) await bind.mainChangeTheme(dark: mode.toShortString());
// Synchronize the window theme of the system.
updateSystemWindowTheme();
}