MockManager mixin
Mixin that manages mock APIs for API logging.
- Superclass constraints
- Mixin applications
Properties
-
getRequestModels
↔ List<
RequestModel> Function()? -
Function to retrieve the list of request models.
getter/setter pair
- 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
-
mockApis
↔ Map<
String, MockApi> -
Stores all mock APIs by their original URL.
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
Methods
-
addOrUpdateMockApi(
MockApi mockApi) → void - Adds or updates a mock API and associates it with the corresponding request model.
-
checkHasMockApi(
String? originalUrl) → bool - Checks if a mock API exists for the given original URL.
-
clearMockApis(
{bool isClearSavedData = false}) → void - Clears all mock APIs, optionally clearing saved data as well.
-
getMockApi(
String url) → MockApi? - Retrieves a mock API by URL.
-
initMock(
{List< RequestModel> getRequestModels()?}) → Future<void> - Initializes the mock API manager and loads saved mock APIs.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeMockApi(
String originalUrl) → void - Removes a mock API and disassociates it from request models.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- mockApiKey → const String
- Key for saving mock API data.