precondition method

  1. @override
bool precondition(
  1. CommandContext<State, System> context,
  2. State state
)
override

Returns true if the command can be run on the given state.

Implementation

@override
bool precondition(CommandContext<State, System> context, State state) {
  return _precondition?.call(state, context.currentValue as T) ?? true;
}