李卓原

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

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