LiZhuoyuan

2.1.0

... ... @@ -6,11 +6,14 @@
* @Description: Update log
-->
#2.0.0
# 2.1.0
- add 'nsp' , you can use 'fontSize: 24.nsp' instead of 'fontSize: ScreenUtil().setSp(24, allowFontScalingSelf: false)'
# 2.0.0
- Use `MediaQueryData.fromWindow(window)` instead of `MediaQuery.of(context)`, no context parameter required
- API changes, please note
#1.1.0
# 1.1.0
- support ExtensionMethod Dart-SDK-2.6.0
- you can use 'width: 50.w' instead of 'width: ScreenUtil().setWidth(50)'
'50.h' instead of 'ScreenUtil().setHeight(50)'
... ...
... ... @@ -24,7 +24,7 @@ dependencies:
flutter:
sdk: flutter
# add flutter_screenutil
flutter_screenutil: ^2.0.0
flutter_screenutil: ^2.1.0
```
### Add the following imports to your Dart code:
... ... @@ -71,6 +71,7 @@ ScreenUtil.init(width: 750, height: 1334, allowFontScaling: true); /
ScreenUtil().setHeight(200) (sdk>=2.6 : 200.h) //Adapted to screen height
ScreenUtil().setSp(24) (sdk>=2.6 : 24.sp) //Adapter font
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //Adapter font(fonts will scale to respect Text Size accessibility settings)
ScreenUtil().setSp(24, allowFontScalingSelf: false) (sdk>=2.6 : 24.nsp) //Adapter font(fonts will not scale to respect Text Size accessibility settings)
ScreenUtil.pixelRatio //Device pixel density
ScreenUtil.screenWidth //Device width
... ...
... ... @@ -29,7 +29,7 @@ dependencies:
flutter:
sdk: flutter
# 添加依赖
flutter_screenutil: ^2.0.0
flutter_screenutil: ^2.1.0
```
### 在每个使用的地方导入包:
... ... @@ -75,6 +75,7 @@ ScreenUtil.init(width: 750, height: 1334, allowFontScaling: true); /
ScreenUtil().setHeight(200) (sdk>=2.6 : 200.h) //根据屏幕高度适配尺寸
ScreenUtil().setSp(24) (sdk>=2.6 : 24.sp) //适配字体
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //适配字体(根据系统的“字体大小”辅助选项来进行缩放)
ScreenUtil().setSp(24, allowFontScalingSelf: false) (sdk>=2.6 : 24.nsp) //适配字体(不会根据系统的“字体大小”辅助选项来进行缩放)
ScreenUtil.pixelRatio //设备的像素密度
ScreenUtil.screenWidth //设备宽度
... ...
... ... @@ -24,7 +24,7 @@ dependencies:
flutter:
sdk: flutter
# add flutter_screenutil
flutter_screenutil: ^2.0.0
flutter_screenutil: ^2.1.0
```
### Adicione o seguinte import em seu código Dart:
... ... @@ -71,6 +71,7 @@ ScreenUtil.init(width: 750, height: 1334, allowFontScaling: true); /
ScreenUtil().setHeight(200) (sdk>=2.6 : 200.h) //Adapted to screen height
ScreenUtil().setSp(24) (sdk>=2.6 : 24.sp) //Adapter font
ScreenUtil().setSp(24, allowFontScalingSelf: true) (sdk>=2.6 : 24.ssp) //Adapter font(fonts will scale to respect Text Size accessibility settings)
ScreenUtil().setSp(24, allowFontScalingSelf: false) (sdk>=2.6 : 24.nsp) //Adapter font(fonts will not scale to respect Text Size accessibility settings)
ScreenUtil.pixelRatio //Device pixel density
ScreenUtil.screenWidth //Device width
... ...
... ... @@ -8,4 +8,6 @@ extension SizeExtension on num {
num get sp => ScreenUtil().setSp(this);
num get ssp => ScreenUtil().setSp(this, allowFontScalingSelf: true);
num get nsp => ScreenUtil().setSp(this, allowFontScalingSelf: false);
}
... ...
name: flutter_screenutil
description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version: 2.0.0
version: 2.1.0
homepage: https://github.com/OpenFlutter/flutter_screenutil
environment:
... ...