precondition method

  1. @override
Future<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
Future<bool> precondition(
  CommandContext<State, System> context,
  State state,
) {
  return asyncCallOr(
    () => _precondition?.call(state, context.currentValue as T),
    true,
  );
}