StubTransportManager
A stub for the transport manager.
Implements TransportCapabilityDelegate as an empty implementation that doesn't perform any network operations. Used when working with static content or in test scenarios.
Constructor
StubTransportManager();
Features
- All methods log a warning that they are not implemented
- Returns empty data for all requests
- When calling
connectwith static content, returns that content
Usage Examples
Automatic Usage
StubTransportManager is automatically used when creating a driver in static mode:
final driver = XDriver.static({
'type': 'Column',
'children': [
{'type': 'Text', 'data': 'Hello World'},
],
});
// StubTransportManager is used internally
Explicit Usage
final driver = XDriver.static(
content,
transportManager: StubTransportManager(),
);
Methods
All TransportCapabilityDelegate methods are implemented, but:
executeRemoteAction— logs a warning, returns emptyMaprequest— logs a warning, returns emptyMapconnect— returns the providedstaticContentor emptyMap
tip
Use StubTransportManager for testing UI without needing to set up a backend.