Device class

Constructors

Device.new({required Size size, required String name, required DisplaySize displaySize, required DevicePlatform platform, double devicePixelRatio = 1.0, double textScale = 1.0, Brightness brightness = Brightness.light, EdgeInsets safeArea = const EdgeInsets.all(0)})
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
displaySize specify display size
final
hashCode int
The hash code for this object.
no setterinherited
name String
name specify device name. Ex: Phone, Tablet, Watch
final
platform DevicePlatform
platform specify platform
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeArea EdgeInsets
safeArea specify insets to define a safe area
final
size Size
size specify device screen size. Ex: Size(1366, 1024))
final
textScale double
textScale specify custom text scale
final

Methods

copyWith({Size? size, double? devicePixelRatio, String? name, double? textScale, Brightness? brightness, EdgeInsets? safeArea, DisplaySize? displaySize, DevicePlatform? platform}) Device
copyWith convenience function for Device modification
dark() Device
dark convenience method to copy the current device and apply dark theme
meetsPlayStoreRequirements() bool
Helper method to check if device meets minimum resolution requirements
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 Screenshots - 20:9 aspect ratio
androidPhoneTall → const Device
Android Phone Screenshots - 18:9 aspect ratio
androidPhoneWide → const Device
Android Phone Screenshots - 16:9 aspect ratio
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
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
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