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 15:45:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Committed by
GitHub
2018-09-24 15:45:38 +0800
Commit
54071f22a944f2fd00920124f74c9e2f47194edf
54071f22
1 parent
df47fcc9
Update README.md
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
README.md
README.md
View file @
54071f2
...
...
@@ -38,15 +38,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
在使用之前请设置好设计稿的宽度和高度,如果不设置则使用默认尺寸
传入设计稿的宽度和高度(单位px),默认为1080
*
1920
推荐在项目入口中设置,以保证在每次使用之前设置好了适配尺寸:
```
ScreenUtil.instance = new ScreenUtil(width: 360, height: 720);
```
### 使用:
```
###
适配尺寸:
适配尺寸:
```
//传入设计稿的px尺寸:
width: ScreenUtil().setWidth(540),
...
...
@@ -54,7 +53,7 @@ height: ScreenUtil().setHeight(200),
```
其他相关api:
```
ScreenUtil.pixelRatio //设备的像素密度
ScreenUtil.screenWidth //设备宽度
ScreenUtil.screenHeight //设备高度
...
...
Please
register
or
login
to post a comment