Maybe<T> class

Constructors

Maybe.nothing()
Maybe.some(T? _value, {bool nullable = false, bool nothingWhen(T? value)?})

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

flatMap<E>(dynamic f) Maybe<E>
map(dynamic f) Maybe<T>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
unwrap() → T?

Operators

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

Static Methods

count<E>(Iterable<Maybe<E>>? maybeList) int
filter<E>(Iterable<Maybe<E>>? maybeIterable) Iterable<E>
flatten<E>(Maybe<Maybe<E>>? maybe) Maybe<E>
forEach<E>(Iterable<Maybe<E>>? maybeIterable, void f(E element)) → void
isNothing<T>(Maybe<T> maybe) bool
isSome<T>(Maybe<T> maybe) bool
mapSome<T, U>(Maybe<T> maybe, U converter(T v)) Maybe<U>
someFrom<T>(Maybe<T> maybe, T defaultValue) → T
when<T>(Maybe<T> maybe, {MaybeNothing? nothing, MaybeSome<T?>? some, MaybeDefault<T>? defaultValue}) → void