addStateInfo function Null safety

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

Useful utility for nesting match states.

Implementation

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