write method
Writes value as the snapshot stored under id, replacing any old value.
Implementation
@override
Future<void> write(String id, String value) {
return _serialized(() async {
await directory.create(recursive: true);
final file = fileFor(id);
final temp = File('${file.path}.tmp');
await temp.writeAsString(value, flush: true);
if (await file.exists()) {
await file.delete();
}
await temp.rename(file.path);
});
}