update method Null safety

Future<int> update(
  1. DatabaseClient databaseClient,
  2. V value,
  3. {Finder? finder}
)

Update records matching a given finder.

Return the count updated. value is merged to the existing.

Implementation

Future<int> update(DatabaseClient databaseClient, V value, {Finder? finder}) {
  final client = getClient(databaseClient);
  value = client.sembastDatabase.sanitizeInputValue<V>(value, update: true)!;
  return client.inTransaction((txn) async {
    return (await client
            .getSembastStore(this)
            .txnUpdateWhere(txn, value, finder: finder))
        .length;
  });
}