fix theme sync

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2022-12-03 16:32:22 +08:00
parent 8646733ae7
commit fb0c75f188

View File

@ -215,18 +215,15 @@ class MyTheme {
}
static void changeDarkMode(ThemeMode mode) {
final preference = getThemeModePreference();
if (preference != mode) {
Get.changeThemeMode(mode);
if (desktopType == DesktopType.main) {
if (mode == ThemeMode.system) {
bind.mainSetLocalOption(key: kCommConfKeyTheme, value: '');
} else {
bind.mainSetLocalOption(
key: kCommConfKeyTheme, value: mode.toShortString());
}
Get.changeThemeMode(mode);
if (desktopType == DesktopType.main) {
bind.mainChangeTheme(dark: currentThemeMode().toShortString());
}
bind.mainChangeTheme(dark: currentThemeMode().toShortString());
}
}