LiZhuoyuan

3.0.2

... ... @@ -5,6 +5,8 @@
* @LastEditTime: 2020年6月20日 11:20:02
* @Description: Update log
-->
# 3.0.2
- Change the unit of'statusBarHeight' and 'bottomBarHeight' to dp
# 3.0.1
- update readme
... ...
... ... @@ -28,7 +28,7 @@ dependencies:
flutter:
sdk: flutter
# add flutter_screenutil
flutter_screenutil: ^3.0.1
flutter_screenutil: ^3.0.2
```
### Add the following imports to your Dart code:
```
... ...
... ... @@ -33,7 +33,7 @@ dependencies:
flutter:
sdk: flutter
# 添加依赖
flutter_screenutil: ^3.0.1
flutter_screenutil: ^3.0.2
```
### 在每个使用的地方导入包:
```
... ...
... ... @@ -28,7 +28,7 @@ dependencies:
flutter:
sdk: flutter
# add flutter_screenutil
flutter_screenutil: ^3.0.1
flutter_screenutil: ^3.0.2
```
### Adicione o seguinte import em seu código Dart:
... ...
... ... @@ -34,8 +34,8 @@ class ScreenUtil {
_pixelRatio = window.devicePixelRatio;
_screenWidth = window.physicalSize.width / _pixelRatio;
_screenHeight = window.physicalSize.height / _pixelRatio;
_statusBarHeight = window.padding.top;
_bottomBarHeight = window.padding.bottom;
_statusBarHeight = window.padding.top / _pixelRatio;
_bottomBarHeight = window.padding.bottom / _pixelRatio;
_textScaleFactor = window.textScaleFactor;
}
... ... @@ -83,11 +83,11 @@ class ScreenUtil {
/// 状态栏高度 dp 刘海屏会更高
/// The offset from the top
double get statusBarHeight => _statusBarHeight / _pixelRatio;
double get statusBarHeight => _statusBarHeight;
/// 底部安全区距离 dp
/// The offset from the bottom.
double get bottomBarHeight => _bottomBarHeight / _pixelRatio;
double get bottomBarHeight => _bottomBarHeight;
/// 实际的dp与UI设计px的比例
/// The ratio of the actual dp to the design draft px
... ...
name: flutter_screenutil
description: A flutter plugin for adapting screen and font size.Guaranteed to look good on different models
version: 3.0.1
version: 3.0.2
homepage: https://github.com/OpenFlutter/flutter_screenutil/tree/beta
environment:
... ...