LayoutTool class Null safety

Constructors

LayoutTool()
工厂
factory

Properties

allowFontScaling bool
控制字体是否要根据系统的“字体大小”辅助选项来进行缩放。默认值为false。 allowFontScaling Specifies whether fonts should scale to respect Text Size accessibility settings. The default is false.
read / write
bottomBarHeight double
底部安全区距离 dp The offset from the bottom.
read-only
hashCode int
The hash code for this object.
read-onlyinherited
pixelRatio double
设备的像素密度 The size of the media in logical pixels (e.g, the size of the screen).
read-only
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scaleHeight double
实际的dp与UI设计px的比例 The ratio of the actual dp to the design draft px
read-only
scaleText double
字体比例
read-only
scaleWidth double
实际的dp与UI设计px的比例 The ratio of the actual dp to the design draft px
read-only
screenHeight double
当前设备高度 dp The vertical extent of this size. dp
read-only
screenHeightPx double
当前设备高度 px The vertical extent of this size. px
read-only
screenWidth double
当前设备宽度 dp The horizontal extent of this size.
read-only
screenWidthPx double
当前设备宽度 px The vertical extent of this size. px
read-only
statusBarHeight double
状态栏高度 dp 刘海屏会更高 The offset from the top
read-only
textScaleFactor double
每个逻辑像素的字体像素数,字体的缩放比例 The number of font pixels for each logical pixel.
read-only
uiSize Size
UI设计中手机尺寸 , px Size of the phone in UI Design , px
read / write

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
setHeight(num height) num
设置Height 根据UI设计的设备高度适配 当发现UI设计中的一屏显示的与当前样式效果不符合时, 或者形状有差异时,建议使用此方法实现高度适配. 高度适配主要针对想根据UI设计的一屏展示一样的效果 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 = false}) num
字体大小适配方法 @param fontSize UI设计上字体的大小,单位px. Font size adaptation method @param fontSize The size of the font on the UI design, in px. @param allowFontScaling
setWebHeight(num scaleHeight) num
设置Height(流式布局) scaleHeight 0 - 1 ,可以是小数 根据UI设计的设备高度适配 当发现UI设计中的一屏显示的与当前样式效果不符合时, 或者形状有差异时,建议使用此方法实现高度适配. 高度适配主要针对想根据UI设计的一屏展示一样的效果 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.
setWebWidth(num scaleWidth) num
设置Width(流式布局) scaleWidth 0 - 1 ,可以是小数 根据UI设计的设备宽度适配 高度也可以根据这个来做适配可以保证不变形,比如你先要一个正方形的时候. 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
setWidth(num width) num
设置Width 根据UI设计的设备宽度适配 高度也可以根据这个来做适配可以保证不变形,比如你先要一个正方形的时候. 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(BuildContext context, {Size designSize = defaultSize, bool allowFontScaling = false}) → void
设置UI设计尺寸及相关信息

Constants

defaultSize → const Size
默认设计图宽高
Size(1080, 1920)