ScreenAdaptationUtil class
width 设计尺寸宽度 width 设计尺寸高度 screenWidth //屏幕宽度 screenHeight //屏幕高度 orientation //屏幕方向 pixelRatio //像素比 statusBarHeight //距离顶部安全距离 bottomBarHeight //距离底部安全距离 textScaleFactor //文字缩放比例 allowFontScaling //是否允许文字缩放
- Implemented types
Constructors
- ScreenAdaptationUtil({double width = 750, double height = 1334, double? screenWidth, double? screenHeight, Orientation? orientation, double? pixelRatio, double? statusBarHeight, double? bottomBarHeight, double? textScaleFactor, bool allowFontScaling = false, double? landscapeWidth, double? landscapeHeight})
Properties
- allowFontScaling ↔ bool
-
getter/setter pair
- bottomBarHeight ↔ double?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- height ↔ double
-
getter/setter pair
- orientation ↔ Orientation?
-
getter/setter pair
- pixelRatio ↔ double?
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenHeight ↔ double?
-
getter/setter pair
- screenWidth ↔ double?
-
getter/setter pair
- statusBarHeight ↔ double?
-
getter/setter pair
- textScaleFactor ↔ double?
-
getter/setter pair
- width ↔ double
-
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setAutomatic(
num wh) → double -
wh
传入width/height 返回较小的适配override -
setHeight(
num height) → double -
height
传入height 返回 适配后的heightoverride -
setSp(
num fontSize, {bool? allowFontScaling}) → double -
fontSize
传入fontSize 返回 适配后的fontSizeoverride -
setWidth(
num width) → double -
width
传入width 返回 适配后的widthoverride -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance ← ScreenAdaptationUtil
-
no getter