Add local data store adapter layer and Hive scaffold
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
/// Raw local state payload and associated schema version.
|
||||
class LocalDataRecord {
|
||||
const LocalDataRecord({required this.rawState, required this.schemaVersion});
|
||||
|
||||
final String rawState;
|
||||
final int schemaVersion;
|
||||
}
|
||||
|
||||
/// Persistence boundary for local app state.
|
||||
abstract interface class LocalDataStore {
|
||||
/// Reads latest persisted state payload.
|
||||
Future<LocalDataRecord?> read();
|
||||
|
||||
/// Writes state payload and schema version.
|
||||
Future<void> write({required String rawState, required int schemaVersion});
|
||||
|
||||
/// Clears persisted state payload.
|
||||
Future<void> clear();
|
||||
}
|
||||
Reference in New Issue
Block a user