networking/src/models/ny_decoder library

Classes

Decode<T>
Decodes a model with its fromJson constructor.
NyDecoder<T>
A decoder that can see the whole response, not only its body.
OneOf<T>
Decodes a response that can have more than one shape.

Functions

decoders(List<Object> entries) → Map<Type, dynamic>
Builds modelDecoders from a list of typed decoders, each keyed by the type it builds. Returns the same map Nylo has always used.
decodeWithDecoders(dynamic json, Map<Type, dynamic> decoders, {required Type type, NyResponse? response}) → dynamic
Runs json through the decoder registered for type in decoders.
findDecoder(Type type, Map<Type, dynamic> decoders) → dynamic
Returns the decoder for type in decoders, or null if there is none.

Typedefs

OneOfBuilder<T> = T Function(dynamic json)
Builds one shape of a OneOf from the response body.