AdapterHolder class

ScreenAdapter Config Holder

Properties

data MediaQueryData
no setter
dpiRatio double
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
targetSize double
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance AdapterHolder
final

Static Methods

covertDp(num value) double
适配 dp,保持缩放比例 先初始化 ProportionAdapter.targetDpi
covertSp(num value) double
适配文字 sp,保持缩放比例 先初始化 ProportionAdapter.targetDpi value 文字大小 该方法目前保持和 covertDp 一致 字体大小 会在 TextStyle 中会受到 MediaQueryData.textScaler 的影响
covertSpf(num value) double
适配文字 spf, 适用于特殊场景 先初始化 ProportionAdapter.targetDpi value 文字大小 该方法将 文字大小缩放至 1.0 倍 仅限于 TextStyle 中使用, 其他场景请使用 covertSpcovertDp 例: Text(text, style: TextStyle(fontSize: ScreenAdapter.covertSpf(value))) 当 MediaQueryData.textScaler 为 TextScaler.noScaling 或者 textScaleFactor=1.0 则无需使用该方法,使用 covertSp 即可