Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
LiZhuoyuan
2020-09-22 00:11:56 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
16d4d6dfc021d7ecf868c5d788775dbc352f6c72
16d4d6df
1 parent
27415ccc
3.0.2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
8 deletions
CHANGELOG.md
README.md
README_CN.md
README_PT.md
lib/screenutil.dart
pubspec.yaml
CHANGELOG.md
View file @
16d4d6d
...
...
@@ -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
...
...
README.md
View file @
16d4d6d
...
...
@@ -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:
```
...
...
README_CN.md
View file @
16d4d6d
...
...
@@ -33,7 +33,7 @@ dependencies:
flutter:
sdk: flutter
# 添加依赖
flutter_screenutil: ^3.0.
1
flutter_screenutil: ^3.0.
2
```
### 在每个使用的地方导入包:
```
...
...
README_PT.md
View file @
16d4d6d
...
...
@@ -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:
...
...
lib/screenutil.dart
View file @
16d4d6d
...
...
@@ -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
...
...
pubspec.yaml
View file @
16d4d6d
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
:
...
...
Please
register
or
login
to post a comment