deleteItem method Null safety

Future<void> deleteItem(
  1. String key,
  2. {Batch? batch}
)

Implementation

Future<void> deleteItem(String key, {Batch? batch}) async {
  bool doCommit = false;
  if (batch == null) {
    doCommit = true;
    batch = await startBatch();
  }

  _delete(batch, key);

  if (doCommit) {
    await commitBatch(batch);
  }
}