ProcessValue<T> class sealed

A union type for ProcessData, ProcessLoading, and ProcessError.

Meant to treat a process declaratively, as a stream of values. This concept is similar to AsyncValue from Riverpod.

Implementers

Constructors

ProcessValue()
A union type for ProcessData, ProcessLoading, and ProcessError.
const
ProcessValue.data(T value)
A value of type T that represents the successful completion of a process.
const
factory
ProcessValue.error(Object error, {StackTrace? stackTrace})
The process failed with an error and optional stackTrace.
const
factory
ProcessValue.loading(double progress)
The process is still running, but progress is available.
const
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
whenData<R>(R mapper(T value)) ProcessValue<R>
Tries to map this ProcessValue to another ProcessValue using the provided mapper function.
whenDataAsync<R>(FutureOr<R> mapper(T value)) Future<ProcessValue<R>>
Tries to map this ProcessValue to another ProcessValue using a an async mapper function.

Operators

operator ==(Object other) bool
The equality operator.
inherited