Optional<T> class

Constructors

Optional(T? _value)
const
Optional.none()
const

Properties

hashCode int
The hash code for this object.
no setteroverride
hasValue bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
unsafe → T?
Avoid using this property.
no setter

Methods

flatMap<U>(Optional<U> f(T)) Optional<U>
flatMap2<T1, U>(Optional<T1> other, Optional<U> f(T, T1)) Optional<U>
flatMap3<T1, T2, U>(Optional<T1> other, Optional<T2> other2, Optional<U> f(T, T1, T2)) Optional<U>
iif<U>({required U some(T), required U none()}) → U
map<U>(U f(T)) Optional<U>
map2<T1, U>(Optional<T1> other, U f(T, T1)) Optional<U>
map3<T1, T2, U>(Optional<T1> other, Optional<T2> other2, U f(T, T1, T2)) Optional<U>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
valueOr(T fallback()) → T

Operators

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