update method Null safety

Future<V?> update(
  1. DatabaseClient databaseClient,
  2. V value

Update a record.

If it does not exist, return null. if value is a map, keys with dot values refer to a path in the map, unless the key is specifically escaped

Returns the updated value.


Future<V?> update(DatabaseClient databaseClient, V value) async {
  var client = getClient(databaseClient);
  value = client.sembastDatabase.sanitizeInputValue<V>(value, update: true)!;
  return await client.inTransaction((txn) {
    return client.getSembastStore(store).txnUpdate(txn, value, key);
  }) as V?;