feat: Add more user related state to hive

This commit is contained in:
Anton Stubenbord
2023-04-23 16:48:11 +02:00
parent 1b9e4fbb81
commit 5c0ef7f853
32 changed files with 408 additions and 272 deletions

View File

@@ -29,7 +29,4 @@ class GlobalSettings with HiveObjectMixin {
this.showOnboarding = true,
this.currentLoggedInUser,
});
static GlobalSettings get boxedValue =>
Hive.box<GlobalSettings>(HiveBoxes.globalSettings).getValue()!;
}

View File

@@ -1,4 +1,5 @@
import 'package:hive/hive.dart';
import 'package:paperless_api/paperless_api.dart';
import 'package:paperless_mobile/core/config/hive/hive_config.dart';
part 'user_settings.g.dart';
@@ -8,7 +9,11 @@ class UserSettings with HiveObjectMixin {
@HiveField(0)
bool isBiometricAuthenticationEnabled;
@HiveField(1)
DocumentFilter currentDocumentFilter;
UserSettings({
this.isBiometricAuthenticationEnabled = false,
required this.currentDocumentFilter,
});
}