UIState.conditional constructor

UIState.conditional({
  1. required String id,
  2. GroupState? parent,
  3. required bool condition()?,
  4. required String? fallbackId,
})

Creates an conditional instance of UIState.

The condition is checked before entering the state and also while the state is active. A failure in the first case blocks the state for transitions, the latter triggers the fallback transition. If parent states are also conditional, the evaluation of the conditions is started from the topmost state.

Implementation

UIState.conditional({
  required this.id,
  this.parent,
  required this.condition,
  required this.fallbackId,
});