FakeDeviceService class

In-memory DeviceService returning fixed device lists.

Records launched and shutdown calls so tests can assert on routing.

Implemented types

Constructors

FakeDeviceService({List<Device> simulators = const [], List<Device> physical = const [], bool available = true})
Creates a fake listing simulators and physical devices.

Properties

available ↔ bool
Returned by isAvailable.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
launched → List<({List<String> args, String deviceId})>
Recorded launchDevice calls, in order.
final
physical ↔ List<Device>
Returned by getPhysicalDevices.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
shutdown → List<String>
Device ids passed to shutdownSimulator, in order.
final
simulators ↔ List<Device>
Returned by getSimulators.
getter/setter pair

Methods

getPhysicalDevices() → Future<List<Device>>
Connected physical devices (phones, tablets, watches, …).
override
getSimulators() → Future<List<Device>>
Emulators / simulators known to the platform SDK.
override
isAvailable() → Future<bool>
Whether the platform tooling is installed and responding.
override
launchDevice({required String deviceId, List<String> additionalArgs = const []}) → Future<void>
Boots or starts deviceId, passing additionalArgs to the launcher.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shutdownSimulator({required String deviceId}) → Future<bool>
Shuts down a simulator/emulator. Returns whether the command succeeded.
override
toString() → String
A string representation of this object.
inherited

Operators

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