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.

Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state TaskState<void, TResult, TError>
Current snapshot of the task's lifecycle state.
no setterinherited

Methods

awaitDone() Future<TResult>
Sugar for firstWhere((s) => s is TaskDone<...>). Resolves with the TaskDone payload (typed TResult).
inherited
awaitFailed() Future<TError>
Sugar for firstWhere((s) => s is TaskFailed<...>). Resolves with the sticky TError payload.
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 eventual TResult. 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 predicate returns true. 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<void, TResult, TError>> listener, {bool fireImmediately = false}) StateListenerDisposer
Registers listener for 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