Device class

This Device is a configuration for golden test. Can be provided for multiScreenGolden

Constructors

Device({required Size size, double devicePixelRatio = 1.0, required String name, 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
hashCode int
The hash code for this object.
no setterinherited
name String
name specify device name. Ex: Phone, Tablet, Watch
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}) Device
copyWith convenience function for Device modification
dark() Device
dark convenience method to copy the current device and apply dark theme
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

Constants

iphone11 → const Device
iphone11 matches specs of iphone11, but with lower DPI for performance
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