TaskResult<T extends Object?> class
Typed view over a TaskStatus returned by helpers such as Stem.waitForTask or canvas typed operations.
Constructors
- TaskResult({required String taskId, required TaskStatus status, T? value, Object? rawPayload, bool timedOut = false})
-
Creates a typed task result snapshot.
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isCancelled → bool
-
Whether the task was cancelled.
no setter
- isFailed → bool
-
Whether the task failed.
no setter
- isSucceeded → bool
-
Whether the task completed successfully.
no setter
- rawPayload → Object?
-
Raw payload stored by the backend (useful for debugging or manual casts).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- status → TaskStatus
-
Latest status snapshot from the backend.
final
- taskId → String
-
Logical task identifier.
final
- timedOut → bool
-
Indicates the helper returned because the timeout elapsed before the task
reached a terminal state.
final
- value → T?
-
Decoded payload when the task succeeded.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
payloadAs<
TResult> ({required PayloadCodec< TResult> codec}) → TResult? -
Decodes the raw persisted task payload with
codec. -
payloadJson<
TResult> ({required TResult decode(Map< String, dynamic> payload), String? typeName}) → TResult? - Decodes the raw persisted task payload with a JSON decoder.
-
payloadVersionedJson<
TResult> ({required int version, required TResult decode(Map< String, dynamic> payload, int version), int? defaultDecodeVersion, String? typeName}) → TResult? - Decodes the raw persisted task payload with a version-aware JSON decoder.
-
requiredValue(
) → T - Returns the decoded value, throwing when it is absent.
-
toString(
) → String -
A string representation of this object.
inherited
-
valueOr(
T fallback) → T -
Returns value or
fallbackwhen the task has no decoded result.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited