runTransaction method
Do the processing to execute the transaction.
Create an adapter-specific ModelTransactionRef that internally inherits from ModelTransactionRef, create a ModelTransactionDocument from that ModelTransactionRef.read, pass it directly to the TransactionRef], create a ModelTransactionDocument from that ModelTransactionRef.read, pass it directly to the transaction
argument, and then execute the transaction
.
トランザクションを実行するための処理を行います。
内部でModelTransactionRefを継承したアダプター専用のModelTransactionRefを作成し、そのModelTransactionRef.readからModelTransactionDocumentを作成、それをそのままtransaction
の引数に渡し、transaction
を実行するようにしてください。
Implementation
@override
FutureOr<void> runTransaction(
FutureOr<void> Function(
ModelTransactionRef ref,
) transaction,
) async {
_assert();
final ref = LocalModelTransactionRef._();
await transaction.call(ref);
for (final tmp in ref._transactionList) {
await tmp.call();
}
}