mirror of
https://github.com/vleeuwenmenno/supplements.git
synced 2025-09-11 18:29:12 +02:00
refactor: update color opacity methods to use withValues for consistency
This commit is contained in:
@@ -10,10 +10,6 @@ enum ThemeOption {
|
||||
class SettingsProvider extends ChangeNotifier {
|
||||
ThemeOption _themeOption = ThemeOption.system;
|
||||
|
||||
// Profile fields
|
||||
DateTime? _dateOfBirth;
|
||||
String? _gender;
|
||||
|
||||
// Time range settings (stored as hours, 0-23)
|
||||
int _morningStart = 5;
|
||||
int _morningEnd = 10;
|
||||
@@ -76,13 +72,6 @@ class SettingsProvider extends ChangeNotifier {
|
||||
final themeIndex = prefs.getInt('theme_option') ?? 0;
|
||||
_themeOption = ThemeOption.values[themeIndex];
|
||||
|
||||
// Load profile fields
|
||||
final dobString = prefs.getString('date_of_birth');
|
||||
if (dobString != null) {
|
||||
_dateOfBirth = DateTime.tryParse(dobString);
|
||||
}
|
||||
_gender = prefs.getString('gender');
|
||||
|
||||
// Load time range settings
|
||||
_morningStart = prefs.getInt('morning_start') ?? 5;
|
||||
_morningEnd = prefs.getInt('morning_end') ?? 10;
|
||||
@@ -112,8 +101,6 @@ class SettingsProvider extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<void> setDateOfBirthAndGender(DateTime dateOfBirth, String gender) async {
|
||||
_dateOfBirth = dateOfBirth;
|
||||
_gender = gender;
|
||||
notifyListeners();
|
||||
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
|
@@ -87,7 +87,7 @@ class SupplementProvider with ChangeNotifier, WidgetsBindingObserver {
|
||||
|
||||
if (currentDate != lastCheckDate) {
|
||||
if (kDebugMode) {
|
||||
printLog('Date changed detected: ${lastCheckDate} -> ${currentDate}');
|
||||
printLog('Date changed detected: $lastCheckDate -> $currentDate');
|
||||
printLog('Refreshing today\'s intakes for new day...');
|
||||
}
|
||||
|
||||
@@ -175,9 +175,6 @@ class SupplementProvider with ChangeNotifier, WidgetsBindingObserver {
|
||||
printLog('Adding supplement: ${supplement.name}');
|
||||
final id = await _databaseHelper.insertSupplement(supplement);
|
||||
printLog('Supplement inserted with ID: $id');
|
||||
final newSupplement = supplement.copyWith(id: id);
|
||||
|
||||
// Notifications will be rescheduled in grouped mode after reloading supplements
|
||||
|
||||
await loadSupplements();
|
||||
printLog('Supplements reloaded, count: ${_supplements.length}');
|
||||
|
Reference in New Issue
Block a user