Polishings
This commit is contained in:
@@ -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();
|
||||
Reference in New Issue
Block a user