changeState method

void changeState(
  1. void action(
    1. T
    )
)

Implementation

void changeState(void Function(T) action) {
  var current = currentState;
  action(current);
  push(current);
}