precondition method
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;
}