networking/ny_networking library

Classes

Decode<T>
Decodes a model with its fromJson constructor.
DefaultResponse<T>
Base class used to handle networking responses
DioApiService
Base API Service class
FilterArgs
Filter arguments for NetworkLogger.filter
NetworkLogger
A network logger interceptor for Dio Provides pretty-printed request/response logging with:
NyApiService
NyDecoder<T>
A decoder that can see the whole response, not only its body.
NyResponse<T>
Enhanced API Response class that provides access to the full Dio Response along with morphed data and useful response utilities
OneOf<T>
Decodes a response that can have more than one shape.

Enums

CachePolicy
Cache policy for API requests.
LogLevelType
Log level for NetworkLogger

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.
RequestHeaders = Map<String, dynamic>
Typedef for RequestHeaders