commitTransaction method

void commitTransaction()

Commits the current transaction into one undoable journal entry.

Implementation

void commitTransaction() {
  final commands = _recordedTransaction();
  if (commands == null) {
    throw StateError('No active transaction to commit');
  }
  if (commands.isEmpty) {
    return;
  }

  final command = commands.length == 1
      ? commands.single
      : _UndoTransactionCommand<State>(commands);
  _appendCommand(command);
}