getSnapshot method Null safety

Future<RecordSnapshot<K, V>?> getSnapshot(
  1. DatabaseClient databaseClient
)

Get a record snapshot from the database.

Implementation

Future<RecordSnapshot<K, V>?> getSnapshot(
    DatabaseClient databaseClient) async {
  var client = getClient(databaseClient);

  var record = await client
      .getSembastStore(store)
      .txnGetRecord(client.sembastTransaction, key);
  return record?.cast<K, V>();
}