Just<T> class abstract

Inheritance

Constructors

Just(T value)
const
factory

Properties

asJust Just<T>
Cast this into a Just, and throw an exception if the cast fails! It might be tempting to just cast the Maybe into the desired type, but it's strongly advised to not do that indiscriminately. Although, it might be convenient to have this cast sometimes. Use it wisely!
no setterinherited
asNothing Nothing
Cast this into a Nothing, and throw an exception if the cast fails! It might be tempting to just cast the Maybe into the desired type, but it's strongly advised to not do that indiscriminately. Although, it might be convenient to have this cast sometimes. Use it wisely!
no setterinherited
copyWith → _$$JustImplCopyWith<T, _$JustImpl<T>>
no setter
hashCode int
The hash code for this object.
no setterinherited
isJust bool
no setterinherited
isNothing bool
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → T
no setter

Methods

getOrElse<Type>(Type fallback) → Type
The getOrElse method which receives a parameter to return as a fallback value, when the value is a Nothing, or there is no value in the Just.
inherited
map<TResult extends Object?>({required TResult nothing(Nothing<T> value), required TResult just(Just<T> value)}) → TResult
inherited
mapAsyncJust<K>(FutureOr<Maybe<K>> combiner(T)) FutureOr<Maybe<K>>
A Method to chain async access to data held by the Maybe. If this is Nothing returns Nothing, if this is Just, returns the result of the combiner method over the value inside Just
inherited
mapJust<K>(Maybe<K> combiner(T)) Maybe<K>
A method to chain access to data held by the Maybe. If this is Nothing returns Nothing, if this is Just, returns the result of the combiner method over the value inside Just
inherited
mapOrNull<TResult extends Object?>({TResult? nothing(Nothing<T> value)?, TResult? just(Just<T> value)?}) → TResult?
inherited
maybeMap<TResult extends Object?>({TResult nothing(Nothing<T> value)?, TResult just(Just<T> value)?, required TResult orElse()}) → TResult
inherited
maybeWhen<TResult extends Object?>({TResult nothing()?, TResult just(T value)?, required TResult orElse()}) → TResult
inherited
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 TResult nothing(), required TResult just(T value)}) → TResult
inherited
whenOrNull<TResult extends Object?>({TResult? nothing()?, TResult? just(T value)?}) → TResult?
inherited

Operators

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