selfprivacy.org.app/lib/logic/get_it/api_config.dart
2024-06-25 18:06:50 +03:00

19 lines
639 B
Dart

import 'package:hive/hive.dart';
import 'package:selfprivacy/config/hive_config.dart';
import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart';
class ApiConfigModel {
final Box _box = Hive.box(BNames.serverInstallationBox);
static const localeCodeFallback = 'en';
String? _localeCode;
String get localeCode => _localeCode ?? localeCodeFallback;
Future<void> setLocaleCode(final String value) async => _localeCode = value;
Future<void> resetLocaleCode() async => _localeCode = null;
Future<void> setBackblazeBucket(final BackblazeBucket value) async {
await _box.put(BNames.backblazeBucket, value);
}
}