Transition<T> constructor

Transition<T>({
  1. Iterable<String> targets = const [],
  2. String? event,
  3. String? description,
  4. Condition<T>? condition,
  5. Duration? after,
  6. dynamic type = TransitionType.externalTransition,
  7. Action<T>? action,
})

Create the appropriate subclass based on the parameters.

Implementation

factory Transition(
        {Iterable<String> targets = const [],
        String? event,
        String? description,
        Condition<T>? condition,
        Duration? after,
        type = TransitionType.externalTransition,
        Action<T>? action}) =>
    event != null
        ? EventTransition<T>(
            event: event,
            targets: targets,
            condition: condition,
            type: type,
            action: action,
            description: description)
        : NonEventTransition<T>(
            after: after,
            targets: targets,
            condition: condition,
            type: type,
            action: action,
            description: description);