dynamic error and success color

This commit is contained in:
2024-11-13 13:47:24 +02:00
parent 948cd5d847
commit d022c2094f

View File

@@ -4,8 +4,8 @@ import "package:universal_html/html.dart" as html;
class MyTheme { class MyTheme {
late int _mainColor; late int _mainColor;
late int _secondColor; late int _secondColor;
late int _errColor; //late int _errColor;
late int _succColor; //late int _succColor;
late int _mesColor; late int _mesColor;
late String mode; late String mode;
late String screenType; late String screenType;
@@ -25,8 +25,8 @@ class MyTheme {
MyTheme() { MyTheme() {
mode = "Dark"; mode = "Dark";
_errColor = 0xffD87E8B; //_errColor = 0xffD87E8B;
_succColor = 0xffB0F2B4; //_succColor = 0xffB0F2B4;
//_mesColor = 0xffc8c8c8d9; //_mesColor = 0xffc8c8c8d9;
} }
@@ -128,7 +128,12 @@ class MyTheme {
} }
Color errorColor() { Color errorColor() {
return Color(_errColor); if (mode == "Dark") {
return const Color(0xffD87E8B);
} else {
return const Color(0xffbb3d4f);
}
//return Color(_errColor);
} }
Color highlightColor() { Color highlightColor() {
@@ -140,7 +145,11 @@ class MyTheme {
} }
Color successColor() { Color successColor() {
return Color(_succColor); if (mode == "Dark") {
return const Color(0xffB0F2B4);
} else {
return const Color(0xff56a95b);
}
} }
AssetImage logoFrame() { AssetImage logoFrame() {