MockManager class

Mock管理器

Constructors

MockManager()
factory

Properties

currentScenario → String?
获取当前场景
no setter
hashCode → int
The hash code for this object.
no setterinherited
isEnabled → bool
检查是否启用Mock
no setter
mockCount → int
获取所有 Mock 数量
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
scenarioMockCount → int
获取当前场景的 Mock 数量
no setter

Methods

clear() → void
清空所有 Mock
disable() → void
禁用Mock
enable() → void
启用Mock
getMockData(String method, String path, Map<String, dynamic>? queryParameters, dynamic data) → MockData?
获取Mock数据
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
register(MockData mock) → void
注册Mock数据
registerAll(List<MockData> mocks) → void
批量注册 Mock
remove(MockData mock) → void
移除指定 Mock
setScenario(String? scenario) → void
设置场景 设置场景后,只有匹配该场景或无场景的 Mock 才会生效
toString() → String
A string representation of this object.
inherited

Operators

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