VoidTask<TResult, TError> class
A Task that takes no parameter. Call it with task() — no null
required. Created via createVoid or Store.createVoidTask.
Internally a thin subclass over Task<void, TResult, TError> that turns
the required positional parameter into an optional one.
Properties
Methods
-
awaitDone(
) → Future< TResult> -
Sugar for
firstWhere((s) => s is TaskDone<...>). Resolves with the TaskDone payload (typedTResult).inherited -
awaitFailed(
) → Future< TError> -
Sugar for
firstWhere((s) => s is TaskFailed<...>). Resolves with the stickyTErrorpayload.inherited -
awaitSettled(
) → Future< TaskState< void, TResult, TError> > -
Resolves on the next sticky settlement — either TaskDone or
TaskFailed. Useful when you want to await any terminal state
without caring which side won.
inherited
-
call(
[void params]) → Future< TResult> -
Invokes the task's underlying async function with
params, returning the eventualTResult. Behaviour under concurrent calls depends on the TaskStrategy (see class-level docs).override -
firstWhere(
bool predicate(TaskState< void, TResult, TError> state)) → Future<TaskState< void, TResult, TError> > -
Resolves with the next TaskState for which
predicatereturnstrue. The current value is checked first — if it already matches, the returned future settles synchronously on the next microtask without subscribing.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
Returns the task to TaskIdle, cancelling pending coalesced
callers and dropping state writes from any in-flight run. The
underlying fn keeps running to completion — Dart has no
cancellation primitive — but its outcome no longer reaches
state and no longer settles callers that subscribed before
the reset.
inherited
-
subscribe(
StateChangeListener< TaskState< listener, {bool fireImmediately = false}) → StateListenerDisposervoid, TResult, TError> > -
Registers
listenerfor imperative observation of state transitions. Returns a disposer that detaches the listener.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited