writeAsBytes method

Future<void> writeAsBytes(
  1. Uint8List contents
)

Implementation

Future<void> writeAsBytes(Uint8List 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;
}