selfprivacy.org.app/lib/logic/get_it/api_config.dart

19 lines
639 B
Dart
Raw Normal View History

2021-03-25 20:09:56 +00:00
import 'package:hive/hive.dart';
import 'package:selfprivacy/config/hive_config.dart';
import 'package:selfprivacy/logic/models/hive/backblaze_bucket.dart';
2021-03-25 20:09:56 +00:00
class ApiConfigModel {
2022-05-24 18:55:39 +00:00
final Box _box = Hive.box(BNames.serverInstallationBox);
2021-03-25 20:09:56 +00:00
static const localeCodeFallback = 'en';
String? _localeCode;
2021-03-25 20:09:56 +00:00
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 {
2021-12-06 18:31:19 +00:00
await _box.put(BNames.backblazeBucket, value);
}
2021-03-25 20:09:56 +00:00
}