Device class

One device an address may name.

Constructors

Device(String id, String label, {required DeviceKind kind, required DevicePlatform platform, required String group, required double width, required double height, required double pixelRatio, double insetTop = 0, double insetRight = 0, double insetBottom = 0, double insetLeft = 0, DeviceInsets? landscape, double keyboard = 0, double? landscapeKeyboard, double? keypadKeyboard, double? landscapeKeypadKeyboard})
const

Properties

canRotate → bool
Whether orientation is a question this device answers. Desktops are windows: there is no other way up.
no setter
group → String
The heading it appears under.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
final
id → String
What goes in an address — ?device=iphone-16.
final
insetBottom → double
final
insetLeft → double
final
insetRight → double
final
insetTop → double
The notch, the island, the gesture bar — whatever is not drawable. Without these an AppBar renders under the cutout and a capture misses the exact thing a phone frame exists to catch.
final
keyboard → double
How tall the software keyboard is on this device, in logical pixels — 0 for a device that has none, which is every desktop size.
final
keypadKeyboard → double?
How tall the digit pad is — what a phone or number field gets — or null where this device does not shrink for one.
final
kind → DeviceKind
final
label → String
What a person reads in the picker.
final
landscape → DeviceInsets?
The safe areas when this device is on its side, or null for the swap-only case: width and height trade places and the insets stay where they are.
final
landscapeKeyboard → double?
The keyboard's height with the device on its side, or null when it has no keyboard at all.
final
landscapeKeypadKeyboard → double?
The digit pad with the device on its side, and null with the same meaning as keypadKeyboard — no shrink, use the landscape letters height.
final
pixelRatio → double
final
platform → DevicePlatform
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
width → double
The screen in logical pixels — the number a layout is written against, and what the app reads from MediaQuery.
final

Methods

keyboardFor(KeyboardVariant variant) → double
How tall this device's keyboard is when a field asks for variant.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
oriented(ScreenOrientation? orientation) → Device
This device as orientation shows it — itself for portrait, for null, and for anything that cannot rotate.
rotated() → Device
This device on its side, whatever it thinks of the idea — oriented is the one that asks canRotate first.
toString() → String
A string representation of this object.
override

Operators

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