RequiredPick class

A picked object holding the value (never null) and giving access to useful parsing functions

Inheritance
Available extensions

Constructors

RequiredPick(dynamic value, {List<Object> path = const [], Map<String, Object?>? context})

Properties

context Map<String, dynamic>
Attaches additional information which can be used during parsing. i.e the HTTP request/response including headers
finalinherited
debugParsingExit String
Returns a human readable String of the requested path and the actual parsed value following the path along (followablePath).
no setterinherited
followablePath List<Object>
The path segments containing non-null values parsing could follow along
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
index int?
The index of the object when it is an element in a List
no setterinherited
isAbsent bool
Allows the distinction between the actual value null and the value not being available
no setterinherited
missingValueAtIndex int?
When the picked value is unavailable (Pick.isAbsent) the index in path which couldn't be found
no setterinherited
path List<Object>
The full path to value inside of the object
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Object
The picked value, might be null
covariantgetter/setter pairoverride-getter

Methods

asBoolOrFalse() bool

Available on Pick, provided by the BoolPick extension

Returns the picked value as bool or defaults to false when the value is null or can't be interpreted as bool.
asBoolOrNull() bool?

Available on Pick, provided by the BoolPick extension

Returns the picked value as bool or null if it can't be interpreted as bool.
asBoolOrThrow() bool

Available on Pick, provided by the BoolPick extension

Returns the picked value as bool or throws a PickException
asBoolOrTrue() bool

Available on Pick, provided by the BoolPick extension

Returns the picked value as bool or defaults to true when the value is null or can't be interpreted as bool.
asDateTimeOrNull({PickDateFormat? format}) DateTime?

Available on Pick, provided by the NullableDateTimePick extension

Parses the picked value as ISO 8601 String to DateTime or returns null
asDateTimeOrThrow({PickDateFormat? format}) DateTime

Available on Pick, provided by the NullableDateTimePick extension

Parses the picked value as ISO 8601 String to DateTime or throws
asDoubleOrNull() double?

Available on Pick, provided by the NullableDoublePick extension

Returns the picked value as double? or returns null when the picked value is absent
asDoubleOrThrow() double

Available on Pick, provided by the NullableDoublePick extension

Returns the picked value as double or throws
asIntOrNull({bool roundDouble = false, bool truncateDouble = false}) int?

Available on Pick, provided by the NullableIntPick extension

Returns the picked value as int? or returns null when the picked value is absent
asIntOrThrow({bool roundDouble = false, bool truncateDouble = false}) int

Available on Pick, provided by the NullableIntPick extension

Returns the picked value as int or throws
asListOrEmpty<T>(T map(RequiredPick), {T whenNull(Pick pick)?}) List<T>

Available on Pick, provided by the NullableListPick extension

Returns the picked value as List or an empty list when the value isn't a List or isAbsent.
asListOrNull<T>(T map(RequiredPick), {T whenNull(Pick pick)?}) List<T>?

Available on Pick, provided by the NullableListPick extension

Returns the picked value as List or null when the value isn't a List or isAbsent.
asListOrThrow<T>(T map(RequiredPick), {T whenNull(Pick pick)?}) List<T>

Available on Pick, provided by the NullableListPick extension

Returns the picked value as List. This method throws when value is not a List or isAbsent
asMapOrEmpty<RK, RV>() Map<RK, RV>

Available on Pick, provided by the NullableMapPick extension

Returns the picked value as Map or an empty map when the value isn't a Map or isAbsent.
asMapOrNull<RK, RV>() Map<RK, RV>?

Available on Pick, provided by the NullableMapPick extension

Returns the picked value as Map or null when the value isn't a Map or isAbsent.
asMapOrThrow<RK, RV>() Map<RK, RV>

Available on Pick, provided by the NullableMapPick extension

Returns the picked value as Map. This method throws when value is not a Map or isAbsent
asString() String

Available on RequiredPick, provided by the RequiredStringPick extension

Returns the picked value as String representation
asStringOrNull() String?

Available on Pick, provided by the NullableStringPick extension

Returns the picked value as String or returns null when the picked value isn't available
asStringOrThrow() String

Available on Pick, provided by the NullableStringPick extension

Returns the picked value as String representation; only throws a PickException when the value is null or isAbsent.
call([Object? arg0, Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6, Object? arg7, Object? arg8, Object? arg9]) Pick
inherited
fromContext(String key, [Object? arg0, Object? arg1, Object? arg2, Object? arg3, Object? arg4, Object? arg5, Object? arg6, Object? arg7, Object? arg8]) Pick
Pick values from the context using the Pick API
inherited
let<R>(R block(RequiredPick pick)) → R

Available on RequiredPick, provided by the Let extension

Maps the pick and returns the result
letOrNull<R>(R? block(RequiredPick pick)) → R?

Available on Pick, provided by the NullableLet extension

Maps the pick if value != null and returns the result.
letOrThrow<R>(R block(RequiredPick pick)) → R

Available on Pick, provided by the NullableLet extension

Maps the non-null value and returns the result. Throws when value == null
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
nullable() Pick
required() RequiredPick
Enter a "required" context which requires the picked value to be non-null or a PickException is thrown.
inherited
toString() String
A string representation of this object.
override
withContext(String key, Object? value) RequiredPick
Attaches additional information which can be used during parsing. i.e the HTTP request/response including headers
override

Operators

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