FileMemoryStore class
A MemoryStore that keeps each snapshot in its own JSON file.
Import it from package:ui_memory/io.dart, so that builds targeting the
web never reach this library. It is available on Android, iOS, desktop and
anywhere else dart:io exists.
Writes go through a temporary file and are renamed into place, so a snapshot is never left half written if the app is killed during a save. Operations are serialized: the last write always wins.
- Implemented types
Constructors
- FileMemoryStore(Directory directory, {String suffix = '.memory.json'})
-
Creates a store writing snapshots inside
directory.
Properties
Methods
-
delete(
String id) → Future< void> -
Deletes the snapshot stored under
id.override -
fileFor(
String id) → File -
Path of the snapshot file for
id. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
read(
String id) → Future< String?> -
Reads the raw snapshot stored under
id, ornullwhen there is none.override -
toString(
) → String -
A string representation of this object.
inherited
-
write(
String id, String value) → Future< void> -
Writes
valueas the snapshot stored underid, replacing any old value.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited