Device
Device information, battery, screen and volume
Device, battery, screen, orientation and volume, grouped under Device.info, Device.battery and Device.screen.
Properties
okBooleaninfoDeviceInfo ›batteryBatteryInfo ›screenScreenInfo ›volumeVolumeInfo ›fonts[String]Font family names installed on the device, sorted. Pass one to Font.custom().
Examples
Display device info
const info = Device.info;
const battery = Device.battery;
const screen = Device.screen;
Column({ children: [
Text(`${info.name} (${info.model})`),
Text(`${info.systemName} ${info.systemVersion}`),
Text(`Battery: ${Math.round(battery.level * 100)}%`),
Text(`Screen: ${screen.width}×${screen.height} @${screen.scale}x`),
Text(`Mode: ${screen.appearance}`)
]});Adaptive layout
const layout = Device.info.isPhone
? Column({ children: [
Text("Phone layout"),
Text(`Volume: ${Math.round(Device.volume.level * 100)}%`)
]})
: Text("Tablet layout");