getTransitionDomain method

  1. @visibleForOverriding
State<T>? getTransitionDomain(
  1. Transition<T> t,
  2. History<T> history
)

The smallest possible subtree containing all the transition targets.

Implementation

@visibleForOverriding
State<T>? getTransitionDomain(Transition<T> t, History<T> history) {
  final tstates = getEffectiveTargetStates(t, history);
  if (tstates.isEmpty) {
    return null;
  }
  if (t.type == TransitionType.internalTransition &&
      t.source!.isCompound &&
      tstates.every((s) => s.descendsFrom(t.source!))) {
    return t.source;
  }
  return State.commonSubtree([t.source!, ...tstates]);
}