createAsyncNoResult<TParam> static method

Command<TParam, void> createAsyncNoResult<TParam>(
  1. Future action(
    1. TParam x
    ), {
  2. ValueListenable<bool>? restriction,
  3. bool? catchAlways,
  4. String? debugName,
})

Creates a Command for an asynchronous handler function with one parameter and no return type action: handler function restriction : ValueListenable<bool> that can be used to enable/disable the command based on some other state change. If omitted the command can be executed always except it's already executing Can't be used with an ValueListenableBuilder because it doesn't have a value but you can register a handler to wait for the completion of the wrapped function. catchAlways : overrides the default set by catchAlwaysDefault. If false, Exceptions thrown by the wrapped function won't be caught but rethrown unless there is a listener on thrownExceptions or results. debugName optional identifier that is included when you register a globalExceptionHandler or a loggingHandler

Implementation

static Command<TParam, void> createAsyncNoResult<TParam>(
    Future Function(TParam x) action,
    {ValueListenable<bool>? restriction,
    bool? catchAlways,
    String? debugName}) {
  return CommandAsync<TParam, void>(
    (x) async => action(x),
    null,
    null,
    restriction,
    false,
    false,
    catchAlways,
    debugName,
    false,
  );
}