Device class

Constructors

Device({required Size size, required String name, DisplaySize displaySize = DisplaySize.sixOne, required DevicePlatform platform, double devicePixelRatio = 1.0, double textScale = 1.0, Brightness brightness = Brightness.light, EdgeInsets safeArea = const EdgeInsets.all(0), double screenCornerRadius = 0, DeviceType? type})
This Device is a configuration for golden test. Can be provided for multiScreenGolden
const

Properties

brightness → Brightness
brightness specify platform brightness
final
devicePixelRatio → double
devicePixelRatio specify device Pixel Ratio
final
displaySize → DisplaySize
The iOS screen size class, used by byDisplaySize and byPlatform's folder names. Android devices have none of their own: their value is nominal (6.1" when not given).
final
effectiveType → DeviceType
type, or, without one, the kind size suggests: a small square is a watch, 600 dp or more across a tablet, anything else a phone. OutputLayout.fastlane files Android screenshots by it.
no setter
hashCode → int
The hash code for this object.
no setterinherited
name → String
name specify device name. Ex: Phone, Tablet, Watch
final
pixelSize → Size
The size of a full-screen capture, in pixels.
no setter
platform → DevicePlatform
platform specify platform
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
safeArea → EdgeInsets
safeArea the system insets (status bar, home indicator) in logical points, as the app reads them from MediaQuery.paddingOf.
final
screenCornerRadius → double
Corner radius of the physical screen in logical points, used when a MarketingFrame draws the screen. 0 means square corners.
final
size → Size
size specify device screen size. Ex: Size(1366, 1024))
final
textScale → double
textScale specify custom text scale
final
type → DeviceType?
What kind of device this is, or null to work it out from size; see effectiveType. Set it for a TV or Chromebook, which size can't tell from a tablet.
final

Methods

copyWith({Size? size, double? devicePixelRatio, String? name, double? textScale, Brightness? brightness, EdgeInsets? safeArea, DisplaySize? displaySize, DevicePlatform? platform, double? screenCornerRadius, DeviceType? type}) → Device
copyWith convenience function for Device modification
dark() → Device
dark convenience method to copy the current device and apply dark theme
meetsPlayStoreRequirements() → bool
Whether a full-screen capture on this device is a valid Google Play screenshot: each side 320–3840 px, and the long side at most twice the short side.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

androidScreenshots({DeviceType type = DeviceType.phone}) → List<Device>
Helper method to get screenshot configurations
byDisplaySize(DisplaySize size) → List<Device>
Filter devices by display size
byPlatform(DevicePlatform platform) → List<Device>

Constants

allDevices → const List<Device>
androidPhone → const Device
Android Phone Screenshots - 9:16 aspect ratio
androidPhoneExtra → const Device
Android phone, 20:9 in landscape: 2400 × 1080 px. Landscape despite the name, as in 1.0; playStorePhoneTall is the portrait 20:9 phone.
androidPhoneTall → const Device
Android phone, 18:9 in landscape: 2160 × 1080 px. Landscape despite the name, as in 1.0; for a tall portrait phone use playStorePhoneTall.
androidPhoneWide → const Device
Android phone, 16:9 landscape: 1920 × 1080 px.
androidTablet → const Device
Android Tablet Screenshots - 16:10 aspect ratio
androidTV → const Device
Android TV Screenshots - 16:9 aspect ratio
appleTV → const Device
Apple TV
appStore → const List<Device>
The sizes App Store Connect requires: iPhone 6.9" and iPad 13".
appStoreIpad13 → const Device
iPad 13" App Store size: 2064 × 2752 px (iPad Pro M4).
appStoreIphone69 → const Device
iPhone 6.9" App Store size: 1320 × 2868 px (iPhone 16 Pro Max).
ipadPro11 → const Device
iPad Devices (11")
ipadPro12_9 → const Device
iPad Devices (12.9")
ipadProM4 → const Device
iPad Devices (13")
iphone8Plus → const Device
iPhone Devices (5.5")
iphone11 → const Device
iphone11 matches specs of iphone11, but with lower DPI for performance
iphone14 → const Device
iPhone Devices (6.1")
iphone14Plus → const Device
iPhone Devices (6.5")
iphone16Pro → const Device
iPhone Devices (6.3")
iphone16ProMax → const Device
iPhone Devices (6.9")
iphoneSE3 → const Device
iPhone Devices (4.7")
macDefault → const Device
Mac (16:10 aspect ratio)
phone → const Device
phone one of the smallest phone screens
playStore → const List<Device>
Google Play phone, 7" tablet and 10" tablet sizes, all 9:16.
playStoreChromebook → const Device
Google Play Chromebook: 1920 × 1080 (16:9 landscape).
playStorePhone → const Device
Google Play phone size: 1080 × 1920 px (9:16).
playStorePhoneTall → const Device
Google Play phone at 1080 × 2400 (20:9), a modern phone's native shape.
playStoreTablet7 → const Device
Google Play 7" tablet size: 1224 × 2176 px (9:16), 612 dp wide.
playStoreTablet10 → const Device
Google Play 10" tablet size: 1620 × 2880 px (9:16), 810 dp wide.
playStoreWear → const Device
Google Play Wear OS: 454 × 454 (1:1). Play asks for square screenshots of at least 384 × 384 and no device frames, so capture these raw, without a MarketingFrame. Play applies its own round mask.
tabletLandscape → const Device
tabletLandscape example of tablet that in landscape mode
tabletPortrait → const Device
tabletPortrait example of tablet that in portrait mode
visionPro → const Device
Apple Vision Pro