mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
fix & opt
fix: cant ping when launch page is ping fix: button text color not primaryColor opt: getting primaryColor
This commit is contained in:
15
lib/data/model/app/dynamic_color.dart
Normal file
15
lib/data/model/app/dynamic_color.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import '../../../core/utils/ui.dart';
|
||||
|
||||
class DynamicColor {
|
||||
/// 白天模式显示的颜色
|
||||
Color light;
|
||||
|
||||
/// 暗黑模式显示的颜色
|
||||
Color dark;
|
||||
|
||||
DynamicColor(this.light, this.dark);
|
||||
|
||||
Color resolve(BuildContext context) => isDarkMode(context) ? dark : light;
|
||||
}
|
||||
@@ -275,4 +275,4 @@ class _TryLimiter {
|
||||
void resetTryTimes(String id) {
|
||||
_triedTimes[id] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 203;
|
||||
static const int build = 205;
|
||||
static const String engine =
|
||||
"Flutter 3.7.0 • channel stable • https://github.com/flutter/flutter.git\nFramework • revision b06b8b2710 (8 days ago) • 2023-01-23 16:55:55 -0800\nEngine • revision b24591ed32\nTools • Dart 2.19.0 • DevTools 2.20.1\n";
|
||||
static const String buildAt = "2023-02-01 12:58:12.944187";
|
||||
static const int modifications = 13;
|
||||
static const String buildAt = "2023-02-01 14:57:28.662965";
|
||||
static const int modifications = 5;
|
||||
}
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:toolbox/data/store/setting.dart';
|
||||
import 'package:toolbox/locator.dart';
|
||||
|
||||
import '../../core/utils/ui.dart';
|
||||
import '../model/app/dynamic_color.dart';
|
||||
|
||||
class DynamicColor {
|
||||
/// 白天模式显示的颜色
|
||||
Color light;
|
||||
Color primaryColor = Color(locator<SettingStore>().primaryColor.fetch()!);
|
||||
|
||||
/// 暗黑模式显示的颜色
|
||||
Color dark;
|
||||
|
||||
DynamicColor(this.light, this.dark);
|
||||
|
||||
resolve(BuildContext context) => isDarkMode(context) ? dark : light;
|
||||
}
|
||||
|
||||
final mainColor = DynamicColor(Colors.black87, Colors.white70);
|
||||
final contentColor = DynamicColor(Colors.black87, Colors.white70);
|
||||
final bgColor = DynamicColor(Colors.white, Colors.black);
|
||||
final progressColor = DynamicColor(Colors.grey.shade100, Colors.white10);
|
||||
|
||||
Reference in New Issue
Block a user