The registry of devices available to the preview and to golden tests.
Ships with phones, foldables, tablets, desktops, wearables and generic resolution presets. Extend it at runtime with register or loadJson so new hardware does not require a new release of this package.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
Static Methods
-
byId(
String id) → DeviceSpec? - The device with the given DeviceSpec.id, or null.
-
exportJson(
) → String - The whole catalog as indented JSON, suitable for loadJson.
-
loadJson(
String source) → int - Registers devices from a JSON document and returns how many were added.
-
query(
{DevicePlatform? platform, DeviceCategory? category, String? vendor, int? releasedAfter}) → List< DeviceSpec> - Devices matching every non-null filter.
-
register(
DeviceSpec device) → void -
Adds
device, replacing any existing entry with the same id. -
registerAll(
Iterable< DeviceSpec> devices) → void -
Adds each of
devices, replacing entries with matching ids. -
remove(
String id) → void - Removes the device with the given id.
-
search(
String term) → List< DeviceSpec> -
Devices whose name, id or vendor contains
term, ignoring case.