mirror of
https://github.com/qinglong-app/qinglong_app.git
synced 2025-10-09 16:48:19 +08:00
add task
This commit is contained in:
@@ -7,11 +7,15 @@ var themeProvider = ChangeNotifierProvider((ref) => ThemeViewModel());
|
||||
class ThemeViewModel extends ChangeNotifier {
|
||||
ThemeData currentTheme = lightTheme;
|
||||
|
||||
ThemeColors themeColor = LightartThemeColors();
|
||||
|
||||
void changeTheme() {
|
||||
if (currentTheme == darkTheme) {
|
||||
currentTheme = lightTheme;
|
||||
themeColor = LightartThemeColors();
|
||||
} else {
|
||||
currentTheme = darkTheme;
|
||||
themeColor = DartThemeColors();
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
@@ -23,3 +27,21 @@ ThemeData darkTheme = ThemeData.dark().copyWith(
|
||||
ThemeData lightTheme = ThemeData.light().copyWith(
|
||||
primaryColor: Color(0xFF0F77FE),
|
||||
);
|
||||
|
||||
abstract class ThemeColors {
|
||||
Color taskTitleColor();
|
||||
}
|
||||
|
||||
class LightartThemeColors extends ThemeColors {
|
||||
@override
|
||||
Color taskTitleColor() {
|
||||
return Color(0xff333333);
|
||||
}
|
||||
}
|
||||
|
||||
class DartThemeColors extends ThemeColors {
|
||||
@override
|
||||
Color taskTitleColor() {
|
||||
return Colors.white;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user