Optional "when charging only" toggle for BG updates (#1914)

This commit is contained in:
Imran Remtulla
2024-10-20 12:51:07 -04:00
parent 07ef86ae75
commit ea239ffa3a
28 changed files with 93 additions and 13 deletions

View File

@@ -349,6 +349,15 @@ class SettingsProvider with ChangeNotifier {
notifyListeners();
}
bool get bgUpdatesWhileChargingOnly {
return prefs?.getBool('bgUpdatesWhileChargingOnly') ?? false;
}
set bgUpdatesWhileChargingOnly(bool val) {
prefs?.setBool('bgUpdatesWhileChargingOnly', val);
notifyListeners();
}
DateTime get lastCompletedBGCheckTime {
int? temp = prefs?.getInt('lastCompletedBGCheckTime');
return temp != null