ResponsiveSize class

Constructors

ResponsiveSize()
factory

Properties

allowFontScaling bool
getter/setter pair
defaultFontSize double
getter/setter pair
designHeightPx double
getter/setter pair
desingWidthPx double
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaleHeight double
no setter
scaleText double
no setter
scaleWidth double
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setHeight(double height) double
Height function 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(double fontSize, {bool? allowFontScalingSelf}) double
FontSize function @param fontSize UI in px. Font size adaptation method @param fontSize The size of the font on the UI design, in px. @param allowFontScaling
setWidth(double width) double
Width function 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 Properties

bottomBarHeight double?
no setter
heightBlock double
no setter
pixelRatio double?
no setter
screenHeight double
no setter
screenHeightPx double?
no setter
screenWidth double
no setter
screenWidthPx double?
no setter
spBlock double
no setter
statusBarHeight double
no setter
statusBarHeightPx double?
no setter
textScaleFactor double?
no setter
widthBlock double
no setter

Static Methods

init({double designWidth = defaultWidth, double designHeight = defaultHeight, bool allowFontScaling = false, double defaultFontSize = 16}) → void

Constants

defaultHeight → const double
defaultWidth → const double