Transaction constructor

Transaction(
  1. Firestore firestore,
  2. TransactionOptions? transactionOptions
)

Implementation

Transaction(
  Firestore firestore,
  TransactionOptions? transactionOptions,
) {
  _firestore = firestore;

  _maxAttempts =
      transactionOptions?.maxAttempts ?? defaultMaxTransactionsAttempts;

  switch (transactionOptions) {
    case ReadOnlyTransactionOptions():
      _readOnlyReadTime = transactionOptions.readTime;
      _writeBatch = null;
    default:
      _writeBatch = WriteBatch._(_firestore);
      _backoff = ExponentialBackoff();
  }
}