RequestManager mixin
Mixin that manages API requests for API logging.
- Superclass constraints
- Mixin applications
Properties
- apiLogConfig ↔ ApiLogConfig
-
Which API log details are captured and logged.
getter/setter pairinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
-
mapKeys
↔ Map<
dynamic, RequestModel> -
Stores request models for quick lookup by key.
getter/setter pair
-
mapsRequest
↔ Map<
dynamic, RequestModel> -
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(
dynamic key, RequestModel model) → void - Adds a request model to the map for the given key.
-
addRequest(
RequestModel requestModel, dynamic key) → dynamic - 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(
CompleteRequestParams params) → void - Completes a request with CompleteRequestParams and notifies listeners.
-
completeRequestByError(
CompleteRequestByErrorParams params) → void - Completes a request with CompleteRequestByErrorParams and notifies listeners.
-
completeRequestByOtherError(
CompleteRequestByOtherErrorParams params) → void - Completes a request with CompleteRequestByOtherErrorParams 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.
-
getNextId(
) → int -
Get the next unique ID.
inherited
-
getRequestModel(
dynamic key) → RequestModel? - Retrieves a request model by key.
-
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(
dynamic key) → RequestModel? - Removes and returns a request model by key.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- markerChildLog → const String
- markerLog → const String