Promise<T> class

Implementers
Annotations
  • @freezed

Constructors

Promise.data(T value, {@Default(true) bool isDone})
const
factory
Promise.error(Object? error)
const
factory
Promise.fromSnapshot(AsyncSnapshot<T> snapshot)
factory
Promise.loading()
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
value → T?
no setter

Methods

map<TResult extends Object?>({required TResult loading(PromiseLoading<T> value), required TResult error(PromiseError<T> value), required TResult data(PromiseData<T> value)}) → TResult
inherited
mapOrNull<TResult extends Object?>({TResult loading(PromiseLoading<T> value)?, TResult error(PromiseError<T> value)?, TResult data(PromiseData<T> value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult loading(PromiseLoading<T> value)?, TResult error(PromiseError<T> value)?, TResult data(PromiseData<T> value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult loading()?, TResult error(Object? error)?, TResult data(T value, bool isDone)?, required TResult orElse()}) → TResult
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
when<TResult extends Object?>({required TResult loading(), required TResult error(Object? error), required TResult data(T value, bool isDone)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult loading()?, TResult error(Object? error)?, TResult data(T value, bool isDone)?}) → TResult?
inherited

Operators

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