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
li_zy
2018-09-24 18:14:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2018-09-24 18:14:38 +0800
Commit
c5f9ebabd18972c3a46c6f1be5eaf507dc2ac863
c5f9ebab
1 parent
e061ed63
Update README.md
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
README.md
README.md
View file @
c5f9eba
...
...
@@ -25,9 +25,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
```
### 设置尺寸
在使用之前请设置好设计稿的宽度和高度,如果不设置则使用默认尺寸
传入设计稿的宽度和高度(单位px),默认为1080
*
1920
### 初始化设置尺寸
在使用之前请设置好设计稿的宽度和高度,传入设计稿的宽度和高度(单位px)
如果不设置则使用默认尺寸,默认为1080
*
1920
推荐在项目入口中设置,以保证在每次使用之前设置好了适配尺寸:
```
...
...
@@ -49,7 +49,7 @@ height: ScreenUtil().setHeight(200),
ScreenUtil.screenWidth //设备宽度
ScreenUtil.screenHeight //设备高度
ScreenUtil.bottomBarHeight //底部安全区距离,适用于全面屏下面有按键的
ScreenUtil.statusBarHeight //状态栏高度 刘海屏会更高
ScreenUtil.statusBarHeight //状态栏高度 刘海屏会更高
单位px
ScreenUtil().scaleWidth //宽度相对于设计稿放大的倍数
ScreenUtil().scaleHeight //高度相对于设计稿放大的倍数
...
...
@@ -101,6 +101,9 @@ import 'package:flutter_app/ScreenUtil.dart'; //导入
);
}
```
example demo: (./example)
`
效果:
上面的205.xxx 是dp的单位,
下面的单位是px
...
...
Please
register
or
login
to post a comment