fetch_tray library
Classes
- FetchTray
- The base class for fetch_tray.
-
FetchTrayPaginationDriver<
RequestType extends TrayRequest, ResultType> -
PagePaginationDriver<
RequestType extends TrayRequest, ResultType> - TrayEnvironment
- The client providing default data to every request being made with it
- TrayPlugin
- Abstract class for plugins to be used with FetchTray
-
TrayRequest<
T> - TrayRequestBody
- The base type for request bodies in post/put/delete requests
- TrayRequestConfig
- TrayRequestError
- An error object, containing details of errors happening in a request
- TrayRequestMetadata
- Contains meta information about a specific request, like pagination data and result information
- TrayRequestMock
- an object containing mock details
-
TrayRequestResponse<
ResultType> - the response class of a tray request, containing either the data or an error object
Enums
- FetchTrayDebugLevel
- FetchTrayLogLevel
- MakeRequestMethod
- available request methods for makeTrayRequest requests
- TrayRequestBodyType
Mixins
-
Paginatable<
ResultType>
Constants
-
validStatuses
→ const List<
int>
Functions
-
logRequest(
{required TrayRequest request, required FetchTrayLogLevel logType, Response? response, FetchTrayDebugLevel? requestDebugLevel, String? message, StackTrace? stackTrace}) → void - provides a shortcut to logging out requests
-
makeTrayRequest<
ModelType> (TrayRequest request, {Dio? 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
-
makeTrayTestingRequest<
ModelType> (TrayRequest request, TrayRequestMock mock, {FetchTrayDebugLevel? requestDebugLevel = FetchTrayDebugLevel.none}) → Future< TrayRequestResponse< ModelType> > - provides a mocked version of the makeTrayRequest method this allows us to easily test every request, without using mockito everywhere