matches method

  1. @override
bool matches({
  1. String? anEvent,
  2. Duration? elapsedTime,
  3. T? context,
  4. dynamic ignoreContext = false,
})
override

Tests whether this transition matches based on elapsedTime and/or condition, ignoring anEvent.

anEvent Ignored. elapsedTime The total time since the last event was triggered. context The data tested by the condition and modified by State.onEntry and State.onExit. ignoreContext If true, skip the condition check (forces it to be true).

Implementation

@override
bool matches(
        {String? anEvent,
        Duration? elapsedTime,
        T? context,
        ignoreContext = false}) =>
    (!ignoreContext && condition != null && meetsCondition(context)) ||
    (elapsedTime != null && elapsedTime.compareTo(after!) >= 0);