feat: add permission screen shown before main screen

This commit is contained in:
fiatcode 2026-04-30 16:11:45 +07:00
parent a7a6a6a82d
commit 650a6efeca
No known key found for this signature in database
6 changed files with 562 additions and 1 deletions

View file

@ -12,6 +12,7 @@ class Preferences {
static const String keyHeartbeat = 'heartbeat';
static const String keyOfflineBuffer = 'offline_buffer';
static const String keyStopDetection = 'stop_detection';
static const String keyPermissionsGranted = 'permissions_granted';
static SharedPreferences? _instance;
@ -52,6 +53,13 @@ class Preferences {
static bool get stopDetection => instance.getBool(keyStopDetection) ?? true;
static bool get permissionsGranted =>
instance.getBool(keyPermissionsGranted) ?? false;
static Future<void> setPermissionsGranted(bool value) async {
await instance.setBool(keyPermissionsGranted, value);
}
static Future<void> setServerUrl(String value) async {
await instance.setString(keyServerUrl, value);
}