TF-4193 Handle multi click to enable Label visibility feature
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
|
||||
class SettingCacheManager {
|
||||
static const String _labelVisibilitySettingKey = 'LABEL_VISIBILITY';
|
||||
|
||||
const SettingCacheManager(this._sharedPreferences);
|
||||
|
||||
final SharedPreferences _sharedPreferences;
|
||||
|
||||
Future<bool> getLabelVisibility() async {
|
||||
await _sharedPreferences.reload();
|
||||
return _sharedPreferences.getBool(_labelVisibilitySettingKey) ?? false;
|
||||
}
|
||||
|
||||
Future<void> saveLabelVisibility(bool visible) async {
|
||||
await _sharedPreferences.setBool(_labelVisibilitySettingKey, visible);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user