Transaction constructor
Transaction(
- Firestore firestore,
- 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();
}
}