rollbackTransaction method

void rollbackTransaction(
  1. State state
)

Reverts all state changes from the active transaction.

Implementation

void rollbackTransaction(State state) {
  final commands = _recordedTransaction();
  if (commands == null) {
    throw StateError('No active transaction to rollback');
  }

  for (var i = commands.length - 1; i >= 0; i--) {
    commands[i].undo(state);
  }
}