execute method

  1. @override
OUTPUT execute()

BANG OPERATOR ALERT! action cannot be null because there is a default condition which returns true always.

Implementation

@override
execute() {
  final Map<bool Function(), OUTPUT Function()> newChildren =
      Map.from(children)..putIfAbsent(defaultCondition, () => defaultAction);
  final condition = newChildren.keys.firstWhere((condition) => condition());
  final action = newChildren[condition];
  return action!();
}