李卓原

字体随系统变化:默认为false

# Generated by pub on 2018-11-19 10:56:16.589695.
# Generated by pub on 2019-01-03 18:12:49.974343.
async:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
boolean_selector:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
charcode:file:///D:/flutter/.pub-cache/hosted/pub.dartlang.org/charcode-1.1.2/lib/
... ...
... ... @@ -23,3 +23,9 @@ Height is enlarged relative to the design draft => The ratio of height width to
///Current device height dp <br/>
///当前设备高度 dp <br/>
ScreenUtil.screenHeightDp
## [0.4.2] - Modify the font to change with the system zoom mode. The default value is false.
setSp(int fontSize, [allowFontScaling = false]) => allowFontScaling
? setWidth(fontSize) * _textScaleFactor
: setWidth(fontSize);
\ No newline at end of file
... ...
... ... @@ -72,8 +72,8 @@ Container(
#### Adapter font:
```
ScreenUtil().setSp(28) //Incoming font size,the unit is pixel, fonts will scale to respect Text Size accessibility settings
ScreenUtil().setSp(28,false) //Incoming font size,the unit is pixel,fonts will not scale to respect Text Size accessibility settings
ScreenUtil().setSp(28) //Incoming font size,the unit is pixel, fonts will not scale to respect Text Size accessibility settings
ScreenUtil().setSp(28,true) //Incoming font size,the unit is pixel,fonts will scale to respect Text Size accessibility settings
for example:
Text(
... ...
... ... @@ -78,8 +78,8 @@ Container(
传入设计稿的px尺寸:
```
ScreenUtil().setSp(28) //传入字体大小,根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,false) //传入字体大小,不会根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28) //传入字体大小,不根据系统的“字体大小”辅助选项来进行缩放
ScreenUtil().setSp(28,true) //传入字体大小,会根据系统的“字体大小”辅助选项来进行缩放
for example:
Text(
... ...
... ... @@ -47,7 +47,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.4.1"
version: "0.4.2"
flutter_test:
dependency: "direct dev"
description: flutter
... ...
... ... @@ -87,7 +87,7 @@ class ScreenUtil {
///@param fontSize 传入设计稿上字体的px ,
///@param allowFontScaling 控制字体是否要根据系统的“字体大小”辅助选项来进行缩放。默认值为true。
///@param allowFontScaling Specifies whether fonts should scale to respect Text Size accessibility settings. The default is true.
setSp(int fontSize, [allowFontScaling = true]) => allowFontScaling
setSp(int fontSize, [allowFontScaling = false]) => allowFontScaling
? setWidth(fontSize) * _textScaleFactor
: setWidth(fontSize);
}
... ...
name: flutter_screenutil
description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version: 0.4.2
version: 0.4.3
author: LiZhuoyuan <zhuoyuan93@gmail.com>
homepage: https://github.com/OpenFlutter/flutter_ScreenUtil
... ...