Option<T> class sealed

Returns optionally given type T wrapped in Some.

If no value is returned, None is returned instead.

Implementers
Available Extensions

Constructors

Option()
const
Option.none()
const
factory
Option.some(T value)
const
factory

Properties

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

Methods

map<TResult extends Object?>({required NoneCallback<TResult> none, required SomeCallback<TResult, T> some}) → TResult
mapOrNull<TResult extends Object?>({NullableNoneCallback<TResult>? none, NullableSomeCallback<TResult, T>? some}) → TResult?
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 ValueNoneCallback<TResult> none, required ValueSomeCallback<TResult, T> some}) → TResult

Operators

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