移动颜色配置到 AppGlobalUIModel

This commit is contained in:
xkeyC 2023-11-10 22:56:55 +08:00
parent 2d70fca71b
commit 6494c7971e
3 changed files with 9 additions and 7 deletions

View File

@ -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";

View File

@ -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<bool> checkUpdate(BuildContext context, {bool init = true}) async {
if (AppConf.isMSE) return true;
if (!init) {

View File

@ -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(