utils/make_tray_request library

Classes

TrayRequestError
An error object, containing details of errors happening in a request
TrayRequestMock
an object containing mock details
TrayRequestResponse<ResultType>
the response class of a tray request, containing either the data or an error object

Enums

MakeRequestMethod
available request methods for makeTrayRequest requests

Constants

validStatuses → const List<int>

Functions

getEnvironmentMethod(Client client, MakeRequestMethod method) Future Function(Uri url, {dynamic body, Map<String, String>? headers})
Maps our MakeRequestMethod enum to the corresponding client method
logRequest({required TrayRequest request, required FetchTrayLogLevel logType, required Response response, FetchTrayDebugLevel? requestDebugLevel, String? message, StackTrace? stackTrace}) → void
provides a shortcut to logging out requests
makeTrayRequest<ModelType>(TrayRequest request, {Client? client, FetchTrayDebugLevel? requestDebugLevel}) Future<TrayRequestResponse<ModelType>>
makes the process of requesting data from an api endpoint easier it takes care of making the request and mocking