KeyedDecoder class abstract

A decoder that can decode iterated collections of key-value pairs of data.

A Decodable implementation can iterate over the collection and decode each value individually. Before each value, the implementation must call nextKey to get the next (or initial) key. The implementation must either call a decoding method, or call skipCurrentValue before calling nextKey again.

A Decodable implementation can also skip the remaining key-value pairs in the collection by calling skipRemainingKeys.

Implemented types
Implementers
Available extensions

Constructors

KeyedDecoder.new()

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

clone() KeyedDecoder
Creates a new Decoder that is a copy of this one.
override
decodeBool() bool
Decodes the data as a boolean value.
inherited
decodeBoolOrNull() bool?
Decodes the data as a nullable boolean value.
inherited
decodeDouble() double
Decodes the data as a double value.
inherited
decodeDoubleOrNull() double?
Decodes the data as a nullable double value.
inherited
decodeFuture<T>({Decodable<T>? using}) Future<T>

Available on Decoder, provided by the AsyncDecoder extension

Decodes a Future of T using the provided Decodable.
decodeFutureOrNull<T>({Decodable<T>? using}) Future<T>?

Available on Decoder, provided by the AsyncDecoder extension

Decodes a Future of T or null using the provided Decodable.
decodeInt() int
Decodes the data as an integer value.
inherited
decodeIntOrNull() int?
Decodes the data as a nullable integer value.
inherited
decodeIsNull() bool
Checks if the data is null.
inherited
decodeIterated() IteratedDecoder
Decodes the data as an iterated collection of nested data.
inherited
decodeKeyed() KeyedDecoder
Decodes the data as a collection of key-value pairs. The pairs are decoded in order of appearance in the encoded data.
inherited
decodeList<E>({Decodable<E>? using}) List<E>
Decodes the data as a list of elements.
inherited
decodeListOrNull<E>({Decodable<E>? using}) List<E>?
Decodes the data as a nullable list of elements.
inherited
decodeMap<K, V>({Decodable<K>? keyUsing, Decodable<V>? valueUsing}) Map<K, V>
Decodes the data as a map of key-value pairs.
inherited
decodeMapOrNull<K, V>({Decodable<K>? keyUsing, Decodable<V>? valueUsing}) Map<K, V>?
Decodes the data as a nullable map of key-value pairs.
inherited
decodeMapped() MappedDecoder
Decodes the data as a collection of key-value pairs. The values are accessed and decoded based on the provided key.
inherited
decodeNum() num
Decodes the data as a num value.
inherited
decodeNumOrNull() num?
Decodes the data as a nullable num value.
inherited
decodeObject<T>({Decodable<T>? using}) → T
Decodes the data as an object of type T.
inherited
decodeObjectOrNull<T>({Decodable<T>? using}) → T?
Decodes the data as a nullable object of type T.
inherited
decodeReference<T>({Decodable<T>? using}) Reference<T>

Available on Decoder, provided by the ReferenceDecoder extension

Decodes a Reference of T using the provided Decodable.
decodeReferenceOrNull<T>({Decodable<T>? using}) Reference<T>?

Available on Decoder, provided by the ReferenceDecoder extension

Decodes a Reference of T or null using the provided Decodable.
decodeStream<T>({Decodable<T>? using}) Stream<T>

Available on Decoder, provided by the AsyncDecoder extension

Decodes a Stream of T using the provided Decodable.
decodeStreamOrNull<T>({Decodable<T>? using}) Stream<T>?

Available on Decoder, provided by the AsyncDecoder extension

Decodes a Stream of T or null using the provided Decodable.
decodeString() String
Decodes the data as a string value.
inherited
decodeStringOrNull() String?
Decodes the data as a nullable string value.
inherited
expect(String expected) → Never
Throws an exception with a detailed message.
inherited
isHumanReadable() bool
Whether a Decodable implementation should expect to decode their human-readable form.
inherited
nextKey() Object?
Moves to the next key-value pair in the collection and returns the key.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
skipCurrentValue() → void
Skips the current value in the collection.
skipRemainingKeys() → void
Skips the remaining key-value pairs in the collection.
toString() String
A string representation of this object.
inherited
whatsNext() DecodingType
Returns the actual or preferred DecodingType of the encoded data.
inherited

Operators

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