Maybe<T> class

A value that knows "missing" from null. Use it for PATCH input.

final Maybe<String?> bio; // default: const Maybe.missing()

if (body.bio.isPresent) user.bio = body.bio.value;

Constructors

Maybe(T value)
The key was sent, with value (which can be null when T is nullable).
const
Maybe.missing()
The key was not sent.
const

Properties

hashCode → int
The hash code for this object.
no setteroverride
isPresent → bool
true when the key was sent.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → T
The value. Throws a StateError when the key was missing.
no setter

Methods

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.
override