GroupingState constructor

GroupingState(
  1. String type,
  2. List<State> states, {
  3. String result = 'null',
})

Implementation

GroupingState(
  super.type,
  List<State> states, {
  super.result,
}) : states = UnmodifiableListView(states.toList()) {
  if (states.isEmpty) {
    throw ArgumentError('Must not be empty', 'states');
  }

  states.first.parent = this;
  for (var i = 1; i < states.length; i++) {
    final previous = states[i - 1];
    final next = states[i - 1];
    previous.next = next;
    next.previous = previous;
  }
}