writeAsString method

Future<void> writeAsString(
  1. String contents
)

Implementation

Future<void> writeAsString(String contents) async {
  final db = await _openDb();
  final txn = db.transaction(_objectStoreName, idbModeReadWrite);
  final store = txn.objectStore(_objectStoreName);
  await store.put({
    _propNameFilePath: _filePath,
    _propNameFileContents: contents
  }); // if the file exists, it will be replaced.
  await txn.completed;
}