devices library

The device vocabulary the GUI's pickers, fw, MCP and the scenario axes all speak — Devices.iphone16, and Device(...) for a screen the table does not have.

Re-exported by plugins.dart (for a project's tool/flutterware.dart) and by flutter_test.dart (for a scenario folder's flutter_test_config.dart), so neither has to import this library by name.

Classes

Device
One device an address may name.
DeviceInsets
A device's safe areas, as one value.
Devices
The devices worth offering, which is not all of them.
PreviewCanvas
The devices one subtree of a package is meant to be seen on.
StagedViewport
A screen to render a preview on, as it travels from the host to a harness.

Enums

DeviceKind
What silhouette to draw around a screen, if any.
DevicePlatform
Ours rather than TargetPlatform, which is Flutter-only. Translated at the one place a frame is drawn.
KeyboardMode
Whether the software keyboard follows the app, or the person looking at it.
KeyboardVariant
Which keyboard a field asked for — what a platform draws, not only how tall it is.
ScreenOrientation
Which way up a device is — an axis applied on top of a Device, not a device of its own.

Constants

fitDeviceId → const String
What ?device= means "no device at all": the panel itself, at whatever size the window happens to be.
previewPanelHeight → const int
previewPanelWidth → const int
The rectangle an entry under no canvas is framed as, in logical pixels at a ratio of 1.

Properties

deviceIds → List<String>
Every value ?device= accepts, fitDeviceId first.
no setter
keyboardModeIds → List<String>
Every value ?keyboard= accepts, the default first.
no setter
orientationIds → List<String>
Every value ?orientation= accepts, portrait first.
no setter

Functions

canvasFor(List<PreviewCanvas> canvases, String path) → PreviewCanvas?
The canvas that applies to path, or null when none of them does.
deviceById(String id) → Device?
The device id names, or null for fitDeviceId and for anything unknown — which the caller must tell apart, because one is a choice and the other is a mistake. See isDeviceId.
isDeviceId(String id) → bool
Whether id is a value this build accepts at all.
isKeyboardModeId(String id) → bool
Whether id is a keyboard mode this build accepts.
isOrientationId(String id) → bool
Whether id is an orientation this build accepts.
keyboardModeById(String id) → KeyboardMode?
The keyboard mode id names, or null for anything unknown.
keyboardVariantForName(String name, {bool signed = false}) → KeyboardVariant
The variant a field asking for name gets.
orientationById(String id) → ScreenOrientation?
The orientation id names, or null for anything unknown.