addStateInfo function

void addStateInfo(
  1. Map matchState,
  2. Map values
)

Useful utility for nesting match states.

Implementation

void addStateInfo(Map matchState, Map values) {
  var innerState = Map.of(matchState);
  matchState.clear();
  matchState['state'] = innerState;
  matchState.addAll(values);
}