new color shit
This commit is contained in:
parent
f1429faf3f
commit
e06b92fde7
@ -99,6 +99,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool _calSyncRenamed;
|
bool _calSyncRenamed;
|
||||||
String _calendarId;
|
String _calendarId;
|
||||||
bool _navShadow;
|
bool _navShadow;
|
||||||
|
bool _newColors;
|
||||||
|
|
||||||
SettingsProvider({
|
SettingsProvider({
|
||||||
DatabaseProvider? database,
|
DatabaseProvider? database,
|
||||||
@ -163,6 +164,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
required bool calSyncRenamed,
|
required bool calSyncRenamed,
|
||||||
required String calendarId,
|
required String calendarId,
|
||||||
required bool navShadow,
|
required bool navShadow,
|
||||||
|
required bool newColors,
|
||||||
}) : _database = database,
|
}) : _database = database,
|
||||||
_language = language,
|
_language = language,
|
||||||
_startPage = startPage,
|
_startPage = startPage,
|
||||||
@ -224,7 +226,8 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
_calSyncShowTeacher = calSyncShowTeacher,
|
_calSyncShowTeacher = calSyncShowTeacher,
|
||||||
_calSyncRenamed = calSyncRenamed,
|
_calSyncRenamed = calSyncRenamed,
|
||||||
_calendarId = calendarId,
|
_calendarId = calendarId,
|
||||||
_navShadow = navShadow;
|
_navShadow = navShadow,
|
||||||
|
_newColors = newColors;
|
||||||
|
|
||||||
factory SettingsProvider.fromMap(Map map,
|
factory SettingsProvider.fromMap(Map map,
|
||||||
{required DatabaseProvider database}) {
|
{required DatabaseProvider database}) {
|
||||||
@ -306,6 +309,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
calSyncRenamed: map['cal_sync_renamed'] == 1,
|
calSyncRenamed: map['cal_sync_renamed'] == 1,
|
||||||
calendarId: map['calendar_id'],
|
calendarId: map['calendar_id'],
|
||||||
navShadow: map['nav_shadow'] == 1,
|
navShadow: map['nav_shadow'] == 1,
|
||||||
|
newColors: map['new_colors'] == 1,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -375,6 +379,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
"cal_sync_renamed": _calSyncRenamed ? 1 : 0,
|
"cal_sync_renamed": _calSyncRenamed ? 1 : 0,
|
||||||
"calendar_id": _calendarId,
|
"calendar_id": _calendarId,
|
||||||
"nav_shadow": _navShadow ? 1 : 0,
|
"nav_shadow": _navShadow ? 1 : 0,
|
||||||
|
"new_colors": _newColors ? 1 : 0,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -448,6 +453,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
calSyncRenamed: false,
|
calSyncRenamed: false,
|
||||||
calendarId: '',
|
calendarId: '',
|
||||||
navShadow: true,
|
navShadow: true,
|
||||||
|
newColors: true,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -512,6 +518,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool get calSyncRenamed => _calSyncRenamed;
|
bool get calSyncRenamed => _calSyncRenamed;
|
||||||
String get calendarId => _calendarId;
|
String get calendarId => _calendarId;
|
||||||
bool get navShadow => _navShadow;
|
bool get navShadow => _navShadow;
|
||||||
|
bool get newColors => _newColors;
|
||||||
|
|
||||||
Future<void> update({
|
Future<void> update({
|
||||||
bool store = true,
|
bool store = true,
|
||||||
@ -572,6 +579,7 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
bool? calSyncRenamed,
|
bool? calSyncRenamed,
|
||||||
String? calendarId,
|
String? calendarId,
|
||||||
bool? navShadow,
|
bool? navShadow,
|
||||||
|
bool? newColors,
|
||||||
}) async {
|
}) async {
|
||||||
if (language != null && language != _language) _language = language;
|
if (language != null && language != _language) _language = language;
|
||||||
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
if (startPage != null && startPage != _startPage) _startPage = startPage;
|
||||||
@ -742,6 +750,9 @@ class SettingsProvider extends ChangeNotifier {
|
|||||||
if (navShadow != null && navShadow != _navShadow) {
|
if (navShadow != null && navShadow != _navShadow) {
|
||||||
_navShadow = navShadow;
|
_navShadow = navShadow;
|
||||||
}
|
}
|
||||||
|
if (newColors != null && newColors != _newColors) {
|
||||||
|
_newColors = newColors;
|
||||||
|
}
|
||||||
// store or not
|
// store or not
|
||||||
if (store) await _database?.store.storeSettings(this);
|
if (store) await _database?.store.storeSettings(this);
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
@ -62,9 +62,19 @@ class AppTheme {
|
|||||||
: _paletteHighlightLight(palette)) ??
|
: _paletteHighlightLight(palette)) ??
|
||||||
lightColors.highlight;
|
lightColors.highlight;
|
||||||
|
|
||||||
Color newSecondary = ColorsUtils().darken(accent, amount: 0.4);
|
Color newSecondary = (accentColor == AccentColor.adaptive ||
|
||||||
|
accentColor == AccentColor.custom ||
|
||||||
|
accentColor == AccentColor.ogfilc) ||
|
||||||
|
!settings.newColors
|
||||||
|
? accent
|
||||||
|
: ColorsUtils().darken(accent, amount: 0.4);
|
||||||
// Color newScaffoldBg = ColorsUtils().lighten(accent, amount: 0.4);
|
// Color newScaffoldBg = ColorsUtils().lighten(accent, amount: 0.4);
|
||||||
Color newTertiary = ColorsUtils().darken(accent, amount: 0.5);
|
Color newTertiary = (accentColor == AccentColor.adaptive ||
|
||||||
|
accentColor == AccentColor.custom ||
|
||||||
|
accentColor == AccentColor.ogfilc) ||
|
||||||
|
!settings.newColors
|
||||||
|
? accent
|
||||||
|
: ColorsUtils().darken(accent, amount: 0.5);
|
||||||
|
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
brightness: Brightness.light,
|
brightness: Brightness.light,
|
||||||
@ -155,8 +165,19 @@ class AppTheme {
|
|||||||
: _paletteHighlightDark(palette)) ??
|
: _paletteHighlightDark(palette)) ??
|
||||||
darkColors.highlight;
|
darkColors.highlight;
|
||||||
|
|
||||||
Color newSecondary = ColorsUtils().lighten(accent, amount: 0.4);
|
Color newSecondary = (accentColor == AccentColor.adaptive ||
|
||||||
Color newTertiary = ColorsUtils().lighten(accent, amount: 0.5);
|
accentColor == AccentColor.custom ||
|
||||||
|
accentColor == AccentColor.ogfilc) ||
|
||||||
|
!settings.newColors
|
||||||
|
? accent
|
||||||
|
: ColorsUtils().lighten(accent, amount: 0.4);
|
||||||
|
// Color newScaffoldBg = ColorsUtils().lighten(accent, amount: 0.4);
|
||||||
|
Color newTertiary = (accentColor == AccentColor.adaptive ||
|
||||||
|
accentColor == AccentColor.custom ||
|
||||||
|
accentColor == AccentColor.ogfilc) ||
|
||||||
|
!settings.newColors
|
||||||
|
? accent
|
||||||
|
: ColorsUtils().lighten(accent, amount: 0.5);
|
||||||
|
|
||||||
return ThemeData(
|
return ThemeData(
|
||||||
brightness: Brightness.dark,
|
brightness: Brightness.dark,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user