Option<T> class
abstract
Represents a value that could be missing - an [option]al value.
If the value is present, then it will be wrapped in a Some instance. If the value is missing, then it will represented with a None instance.
- Implementers
- Available extensions
Constructors
- Option()
-
const
- Option.fromJson(dynamic json, T fromJsonT(dynamic json))
-
Adds support for the
json_serializable
package.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
Methods
-
extract<
T> (K key) → Option< T> -
Available on Option<
Return an Option that conditionally accesses map keys, if they match the given type. Useful for accessing nested JSON.Map< , provided by the MapOptionExtension extensionK, dynamic> > -
extractMap(
K key) → Option< Map< K, dynamic> > -
Available on Option<
Return an Option that conditionally accesses map keys, if they contain a map with the same key type. Useful for accessing nested JSON.Map< , provided by the MapOptionExtension extensionK, dynamic> > -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
Object? toJsonT(T v)) → Object? -
Adds support for the
json_serializable
package. -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited