fix: задание от стасика

This commit is contained in:
Jganenokk
2026-06-28 16:38:32 +07:00
parent c23a6dcfd6
commit 87373c4012
9 changed files with 376 additions and 188 deletions
+20
View File
@@ -0,0 +1,20 @@
import 'package:flutter/foundation.dart';
import 'package:shared_preferences/shared_preferences.dart';
class AppShowExtraInfo {
static const prefKey = 'dev_show_extra_info';
static const bool defaultValue = false;
static final ValueNotifier<bool> current = ValueNotifier(defaultValue);
static Future<bool> load() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getBool(prefKey) ?? defaultValue;
}
static Future<void> save(bool value) async {
current.value = value;
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(prefKey, value);
}
}