Device class
A physical device, emulator, or simulator known to SimUtil.
Constructors
- Device({required String id, required String name, required DeviceOs os, required String platform, required DeviceState state, required DeviceType type})
-
Creates a device with explicit fields.
const
- Device.android({required String id, required String name, required DeviceState state, required DeviceType type})
-
Android emulator or hardware device (
osis DeviceOs.android).factory -
Device.fromJson(Map<
String, dynamic> json) -
Restores a Device from toJson output.
factory
- Device.ios({required String id, required String name, String? platform, required DeviceState state, required DeviceType type})
-
Apple family device (
osis DeviceOs.ios, including iPad/Watch/TV).factory
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Stable identifier (serial, AVD name, or UDID).
final
- isRunning → bool
-
Whether state is booted or booting.
no setter
- name → String
-
Human-readable name.
final
- os → DeviceOs
-
OS family used for filtering (Android vs Apple).
final
- platform → String
-
Display string such as
AndroidoriOS 17.2.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- state → DeviceState
-
Running, booting, or shut down.
final
- type → DeviceType
-
Physical hardware vs emulator/simulator.
final
Methods
-
copyWith(
{String? id, String? name, DeviceOs? os, String? platform, DeviceState? state, DeviceType? type}) → Device - Returns a copy with selected fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Serializes this device for JSON persistence.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override