Skip to content

Commit bd7355c

Browse files
committed
2.1.0
1 parent 8c2d87c commit bd7355c

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
* @LastEditTime: 2020年6月20日 11:20:02
66
* @Description: Update log
77
-->
8+
9+
# 2.1.0
10+
- add 'nsp' , you can use 'fontSize: 24.nsp' instead of 'fontSize: ScreenUtil().setSp(24, allowFontScalingSelf: false)'
811

9-
#2.0.0
12+
# 2.0.0
1013
- Use `MediaQueryData.fromWindow(window)` instead of `MediaQuery.of(context)`, no context parameter required
1114
- API changes, please note
1215

13-
#1.1.0
16+
# 1.1.0
1417
- support ExtensionMethod Dart-SDK-2.6.0
1518
- you can use 'width: 50.w' instead of 'width: ScreenUtil().setWidth(50)'
1619
'50.h' instead of 'ScreenUtil().setHeight(50)'

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
flutter:
2525
sdk: flutter
2626
# add flutter_screenutil
27-
flutter_screenutil: ^2.0.0
27+
flutter_screenutil: ^2.1.0
2828
```
2929

3030
### Add the following imports to your Dart code:
@@ -71,6 +71,7 @@ ScreenUtil.init(width: 750, height: 1334, allowFontScaling: true); /
7171
ScreenUtil().setHeight(200) (sdk>=2.6 : 200.h) //Adapted to screen height
7272
ScreenUtil().setSp(24) (sdk>=2.6 : 24.sp) //Adapter font
7373
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //Adapter font(fonts will scale to respect Text Size accessibility settings)
74+
ScreenUtil().setSp(24, allowFontScalingSelf: false) (sdk>=2.6 : 24.nsp) //Adapter font(fonts will not scale to respect Text Size accessibility settings)
7475
7576
ScreenUtil.pixelRatio //Device pixel density
7677
ScreenUtil.screenWidth //Device width

README_CN.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ dependencies:
2929
flutter:
3030
sdk: flutter
3131
# 添加依赖
32-
flutter_screenutil: ^2.0.0
32+
flutter_screenutil: ^2.1.0
3333
```
3434

3535
### 在每个使用的地方导入包:
@@ -74,7 +74,8 @@ ScreenUtil.init(width: 750, height: 1334, allowFontScaling: true); /
7474
ScreenUtil().setWidth(540) (sdk>=2.6 : 540.w) //根据屏幕宽度适配尺寸
7575
ScreenUtil().setHeight(200) (sdk>=2.6 : 200.h) //根据屏幕高度适配尺寸
7676
ScreenUtil().setSp(24) (sdk>=2.6 : 24.sp) //适配字体
77-
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //适配字体(根据系统的“字体大小”辅助选项来进行缩放)
77+
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //适配字体(根据系统的“字体大小”辅助选项来进行缩放)
78+
ScreenUtil().setSp(24, allowFontScalingSelf: false) (sdk>=2.6 : 24.nsp) //适配字体(不会根据系统的“字体大小”辅助选项来进行缩放)
7879
7980
ScreenUtil.pixelRatio //设备的像素密度
8081
ScreenUtil.screenWidth //设备宽度

README_PT.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
flutter:
2525
sdk: flutter
2626
# add flutter_screenutil
27-
flutter_screenutil: ^2.0.0
27+
flutter_screenutil: ^2.1.0
2828
```
2929

3030
### Adicione o seguinte import em seu código Dart:
@@ -70,7 +70,8 @@ ScreenUtil.init(width: 750, height: 1334, allowFontScaling: true); /
7070
ScreenUtil().setWidth(540) (sdk>=2.6 : 540.w) //Adapted to screen width
7171
ScreenUtil().setHeight(200) (sdk>=2.6 : 200.h) //Adapted to screen height
7272
ScreenUtil().setSp(24) (sdk>=2.6 : 24.sp) //Adapter font
73-
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //Adapter font(fonts will scale to respect Text Size accessibility settings)
73+
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //Adapter font(fonts will scale to respect Text Size accessibility settings)
74+
ScreenUtil().setSp(24, allowFontScalingSelf: false) (sdk>=2.6 : 24.nsp) //Adapter font(fonts will not scale to respect Text Size accessibility settings)
7475
7576
ScreenUtil.pixelRatio //Device pixel density
7677
ScreenUtil.screenWidth //Device width

lib/size_extension.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ extension SizeExtension on num {
88
num get sp => ScreenUtil().setSp(this);
99

1010
num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);
11+
12+
num get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false);
1113
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: flutter_screenutil
22
description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
3-
version: 2.0.0
3+
version: 2.1.0
44
homepage: https://github.com/OpenFlutter/flutter_screenutil
55

66
environment:

0 commit comments

Comments
 (0)