Polishings

This commit is contained in:
warlock
2022-03-07 18:52:36 +05:30
parent f749c4ce8d
commit 455483299f
11 changed files with 461 additions and 230 deletions

View File

@@ -108,6 +108,7 @@ class Settings{
static String notification_key= "notification_interval";
static String adaptive_notification_key = "adaptive_notification";
static String untracked_unprod_key = "untracked_unproductive";
static Future<int> getNotificationInterval() async{
final prefs = await SharedPreferences.getInstance();
@@ -161,5 +162,23 @@ class Settings{
final prefs = await SharedPreferences.getInstance();
prefs.setBool(adaptive_notification_key, value);
}
static Future<bool> getUntrackedUnproductive() async{
final prefs = await SharedPreferences.getInstance();
bool _value = true;
if(prefs.containsKey(untracked_unprod_key)){
_value = await prefs.getBool(untracked_unprod_key) ?? true;
}else{
prefs.setBool(untracked_unprod_key,_value);
}
return _value;
}
static Future<void> setUntrackedUnproductive(bool value) async{
final prefs = await SharedPreferences.getInstance();
prefs.setBool(untracked_unprod_key, value);
}
}
final settings = Settings();