From 013e862a05d3656c9e769ab7333707a329b5eafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=8D=93=E5=8E=9F?= Date: Thu, 3 Jan 2019 18:17:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E4=BD=93=E9=9A=8F=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E5=8F=98=E5=8C=96:=E9=BB=98=E8=AE=A4=E4=B8=BAfalse?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .packages | 2 +- CHANGELOG.md | 6 ++++++ README.md | 4 ++-- README_CN.md | 4 ++-- example/pubspec.lock | 2 +- lib/flutter_screenutil.dart | 2 +- pubspec.yaml | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.packages b/.packages index 59edfdb..1218dbd 100644 --- a/.packages +++ b/.packages @@ -1,4 +1,4 @@ -# 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/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 57d2c1e..24cd4b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,3 +23,9 @@ Height is enlarged relative to the design draft => The ratio of height width to ///Current device height dp
///当前设备高度 dp
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 diff --git a/README.md b/README.md index 1c9febf..a5dc0f0 100644 --- a/README.md +++ b/README.md @@ -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( diff --git a/README_CN.md b/README_CN.md index 1ad089d..7a8ccbc 100644 --- a/README_CN.md +++ b/README_CN.md @@ -78,8 +78,8 @@ Container( 传入设计稿的px尺寸: ``` - ScreenUtil().setSp(28) //传入字体大小,根据系统的“字体大小”辅助选项来进行缩放 - ScreenUtil().setSp(28,false) //传入字体大小,不会根据系统的“字体大小”辅助选项来进行缩放 + ScreenUtil().setSp(28) //传入字体大小,不根据系统的“字体大小”辅助选项来进行缩放 + ScreenUtil().setSp(28,true) //传入字体大小,会根据系统的“字体大小”辅助选项来进行缩放 for example: Text( diff --git a/example/pubspec.lock b/example/pubspec.lock index 8fc5051..d22326e 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -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 diff --git a/lib/flutter_screenutil.dart b/lib/flutter_screenutil.dart index 47e0cf8..3666c55 100644 --- a/lib/flutter_screenutil.dart +++ b/lib/flutter_screenutil.dart @@ -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); } diff --git a/pubspec.yaml b/pubspec.yaml index f137fe7..c0dcf3e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ 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 homepage: https://github.com/OpenFlutter/flutter_ScreenUtil