None<T> class final

An Option with no value.

Inheritance
Available Extensions

Constructors

None()
Creates an Option with no value.
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isNone bool
Whether this is a None.
no setteroverride
isSome bool
Whether this is a Some.
no setteroverride
iterable Iterable<T>
Returns an iterable over the possibly contained value.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valueOrNull Null
The contained value if this is a Some, or null otherwise.
no setteroverride

Methods

and<U>(Option<U> other) None<U>
Returns other if this is a Some, or None otherwise.
override
andThen<U>(Option<U> calculateOther(T value)) None<U>
Returns the result of calculateOther if this is a Some, or None otherwise.
override
contains(T value) bool
Returns true if this is a Some of the given value.
override
inspect(void inspect(T value)) None<T>
Calls inspect with the contained value if this is a Some.
override
isSomeAnd(bool condition(T value)) bool
Returns true if this is a Some with a contained value that satisfies condition.
override
map<U>(U map(T value)) None<U>
Transforms the contained value, if any, by applying map to it.
override
mapOr<U>(U map(T value), U defaultValue) → U
Returns the contained value, if any, with map applied to it, or defaultValue otherwise.
override
mapOrElse<U>(U map(T value), U calculateDefaultValue()) → U
Returns the contained value, if any, with map applied to it, or the result of calculateDefaultValue otherwise.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
okOr<E>(E error) Err<T, E>
Transforms an Option into a Result, mapping Some to an Ok of the contained value and None to Err of error.
override
okOrElse<E>(E calculateError()) Err<T, E>
Transforms an Option into a Result, mapping Some to an Ok of the contained value and None to Err of the result of calculateError.
override
or(Option<T> other) Option<T>
Returns a Some of the original value if this is a Some, or other otherwise.
override
orElse(Option<T> calculateOther()) Option<T>
Returns a Some of the original value if this is a Some, or the result of calculateOther otherwise.
override
toString() String
A string representation of this object.
override
unwrap({String? msg}) → Never
Returns the contained value.
override
unwrapOr(T defaultValue) → T
Returns the contained value, if any, or defaultValue otherwise.
override
unwrapOrElse(T calculateDefaultValue()) → T
Returns the contained value, if any, or the result of calculateDefaultValue otherwise.
override
where(bool condition(T value)) None<T>
Returns a Some of the original value if this is a Some and its contained value satisfies condition, or None otherwise.
override
whereType<U>() None<U>
Returns a Some of the original value if this is a Some with a contained value of type U, or None otherwise.
override
xor(Option<T> other) Option<T>
Returns a Some if either, but not both, of this and other is a Some, or None otherwise.
override
zip<U>(Option<U> other) None<(T, U)>
Returns a tuple of both this and other if both are Some, or None otherwise.
override
zipWith<U, R>(Option<U> other, R zip(T value, U otherValue)) None<R>
Returns the result of zip called with both this and other if both are Some, or None otherwise.
override

Operators

operator ==(covariant Option<T> other) bool
The equality operator.
override