ResponsiveScreenUtil class

Constructors

ResponsiveScreenUtil()
factory

Properties

allowFontScaling bool
allowFontScaling Specifies whether fonts should scale to respect Text Size accessibility settings. The default is false.
getter/setter pair
bottomBarHeight double
The offset from the bottom, in dp
no setter
hashCode int
The hash code for this object.
no setterinherited
pixelRatio double
The size of the media in logical pixels (e.g, the size of the screen).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleHeight double
The ratio of actual height to UI design
no setter
scaleText double
no setter
scaleWidth double
The ratio of actual width to UI design
no setter
screenHeight double
The vertical extent of this size. dp
no setter
screenWidth double
当前设备宽度 dp The horizontal extent of this size.
no setter
statusBarHeight double
The offset from the top, in dp
no setter
textScaleFactor double
The number of font pixels for each logical pixel.
no setter
uiSize Size
Size of the phone in UI Design , dp
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
radius(num r) double
Adapt according to the smaller of width or height
setHeight(num height) double
Highly adaptable to the device according to UI Design It is recommended to use this method to achieve a high degree of adaptation when it is found that one screen in the UI design does not match the current style effect, or if there is a difference in shape.
setSp(num fontSize, {bool? allowFontScalingSelf}) double
Font size adaptation method
setWidth(num width) double
Adapted to the device width of the UI Design. Height can also be adapted according to this to ensure no deformation , if you want a square
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

init(BoxConstraints constraints, {Size designSize = defaultSize, bool allowFontScaling = false}) → void

Constants

defaultSize → const Size