diff --git a/lib/common/conf.dart b/lib/common/conf.dart index 26b0c07..025f7e1 100644 --- a/lib/common/conf.dart +++ b/lib/common/conf.dart @@ -43,10 +43,6 @@ class AppConf { static late final WindowsDeviceInfo windowsDeviceInfo; - static String colorBackground = "#132431"; - static String colorMenu = "#122D42"; - static String colorMica = "#0A3142"; - static const isMSE = String.fromEnvironment("MSE", defaultValue: "false") == "true"; diff --git a/lib/global_ui_model.dart b/lib/global_ui_model.dart index 980f71a..bdee570 100644 --- a/lib/global_ui_model.dart +++ b/lib/global_ui_model.dart @@ -16,6 +16,11 @@ final globalUIModel = AppGlobalUIModel(); final globalUIModelProvider = ChangeNotifierProvider((ref) => globalUIModel); class AppGlobalUIModel extends BaseUIModel { + + String colorBackground = "#132431"; + String colorMenu = "#122D42"; + String colorMica = "#0A3142"; + Future checkUpdate(BuildContext context, {bool init = true}) async { if (AppConf.isMSE) return true; if (!init) { diff --git a/lib/main.dart b/lib/main.dart index 992a21f..9320d07 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -36,10 +36,11 @@ class AppUI extends BaseUI { brightness: Brightness.dark, fontFamily: "SourceHanSansCN-Regular", navigationPaneTheme: NavigationPaneThemeData( - backgroundColor: HexColor(AppConf.colorBackground).withOpacity(.75), + backgroundColor: + HexColor(globalUIModel.colorBackground).withOpacity(.75), ), - menuColor: HexColor(AppConf.colorMenu).withOpacity(.95), - micaBackgroundColor: HexColor(AppConf.colorMica), + menuColor: HexColor(globalUIModel.colorMenu).withOpacity(.95), + micaBackgroundColor: HexColor(globalUIModel.colorMica), ), debugShowCheckedModeBanner: false, home: BaseUIContainer(