Option<T> class
Option is used as a result that represents some value or none.
Constructors
- Option.none()
- Option.none is the constructor for an Option with no value.
- Option.some(T? _value)
- Option.some is the constructor for an Option with some value.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- option ↔ OptionState
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → T
-
value is a getter that returns the value.
no setter
Methods
-
isNone(
) → bool - isNone returns false if no value is set (none).
-
isSome(
) → bool - isSome returns true if a value is set (some).
-
isState(
OptionState v) → bool - isState returns true if the state equals v.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited