RequestManager mixin

Mixin that manages API requests for API logging.

Superclass constraints
Mixin applications

Properties

hashCode int
The hash code for this object.
no setterinherited
isLogCurl bool
Whether curl logging is enabled.
getter/setter pairinherited
isLogEnabled bool
Whether logging is enabled.
getter/setter pairinherited
isOnlyShowErrorApis bool
Whether to only show error APIs.
getter/setter pair
listeners List<void Function(List<BaseModel> requestModels)>
Listeners to be notified when the list of requests changes.
getter/setter pair
mapRequestOptions Map<RequestOptions, RequestModel>
Stores request models for quick lookup by RequestOptions.
getter/setter pair
mapsRequest Map<RequestOptions, RequestModel>
Stores all request models by their RequestOptions.
getter/setter pair
models List<BaseModel>
The list of models tracked by the logger.
getter/setter pairinherited
The navigator key for navigation operations.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
saveManager SaveManager
The save manager for persistent storage.
getter/setter pairinherited
valueFromResponse ValueFromResponse
Strategies for extracting values from API responses.
getter/setter pair

Methods

addListener(void listener(List<BaseModel> requestModels)) → void
Adds a listener for request model changes.
addMapRequestOption(RequestOptions options, RequestModel model) → void
Adds a request model to the map for the given RequestOptions.
addRequest(RequestModel requestModel, RequestOptions options) → void
Adds a new request model and notifies listeners.
calcContentLength(Map<String, dynamic> headers) int
Calculates the content length from HTTP headers.
clearRequests() → void
Clears all request models and notifies listeners.
completeRequest(Response response) → void
Completes a request with a Response and notifies listeners.
completeRequestByError(DioException error) → void
Completes a request with a DioException and notifies listeners.
completeRequestByOtherError(Exception error, RequestOptions options) → void
Completes a request with an Exception and notifies listeners.
fireEvent() → void
Notifies all listeners of request model changes.
getErrorRequests() List<RequestModel>
Returns a list of requests that are considered errors by the API response.
getHttpErrorRequests() List<RequestModel>
Returns a list of requests with HTTP error codes (not 2xx).
getInProgressRequests() List<RequestModel>
Returns a list of requests that are still in progress.
getRequestModel(RequestOptions options) RequestModel?
Retrieves a request model by RequestOptions.
initRequestManager({MockApi? getMockApi(String url)?}) → void
Initializes the request manager with a function to get mock APIs.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeListener(void listener(List<BaseModel> requestModels)) → void
Removes a listener for request model changes.
removeRequestModel(RequestOptions options) RequestModel?
Removes and returns a request model by RequestOptions.
toString() String
A string representation of this object.
inherited

Operators

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