txn<T> method

Future<void> txn<T>(
  1. Future<T> action()
)

Completes the provided action as a db transaction.

Implementation

Future<void> txn<T>(Future<T> Function() action) async {
  if (isClosed || db == null) {
    return;
  }

  await _caught(db?.transaction(action));
}