setSp method

num setSp(
  1. num fontSize, {
  2. bool allowFontScalingSelf = false,
})

字体大小适配方法 @param fontSize UI设计上字体的大小,单位px. Font size adaptation method @param fontSize The size of the font on the UI design, in px. @param allowFontScaling

Implementation

num setSp(num fontSize, {bool allowFontScalingSelf = false}) =>
    allowFontScalingSelf == false
        ? (allowFontScaling
            ? (fontSize * scaleText)
            : ((fontSize * scaleText) / _textScaleFactor))
        : (allowFontScalingSelf
            ? (fontSize * scaleText)
            : ((fontSize * scaleText) / _textScaleFactor));