li_zy
Committed by GitHub

Update README.md

@@ -17,20 +17,20 @@ csdn博客本工具介绍:https://blog.csdn.net/u011272795/article/details/82795 @@ -17,20 +17,20 @@ csdn博客本工具介绍:https://blog.csdn.net/u011272795/article/details/82795
17 17
18 使用方法: 18 使用方法:
19 19
20 -```  
21 导入包: 20 导入包:
22 - 21 +```
23 import 'package:flutter_app/ScreenUtil.dart'; //导入 22 import 'package:flutter_app/ScreenUtil.dart'; //导入
  23 +```
24 24
25 在使用之前请设置好设计稿的宽度和高度,如果不设置则使用默认尺寸 25 在使用之前请设置好设计稿的宽度和高度,如果不设置则使用默认尺寸
26 传入设计稿的宽度和高度(单位px),默认为1080*1920 26 传入设计稿的宽度和高度(单位px),默认为1080*1920
27 推荐在main.dart中设置,以保证在使用之前设置好了适配尺寸: 27 推荐在main.dart中设置,以保证在使用之前设置好了适配尺寸:
28 - 28 +```
29 ScreenUtil.instance = new ScreenUtil(width: 360, height: 720); 29 ScreenUtil.instance = new ScreenUtil(width: 360, height: 720);
30 - 30 +```
31 31
32 使用: 32 使用:
33 - 33 +```
34 .... 34 ....
35 //传入设计稿的px尺寸: 35 //传入设计稿的px尺寸:
36 36
@@ -40,7 +40,7 @@ height: ScreenUtil().setHeight(200), @@ -40,7 +40,7 @@ height: ScreenUtil().setHeight(200),
40 40
41 其他相关api: 41 其他相关api:
42 42
43 - print(ScreenUtil.pixelRatio); //设备的像素密度 43 + print(ScreenUtil.pixelRatio); //设备的像素密度
44 print(ScreenUtil.screenWidth); //设备宽度 44 print(ScreenUtil.screenWidth); //设备宽度
45 print(ScreenUtil.screenHeight); //设备高度 45 print(ScreenUtil.screenHeight); //设备高度
46 print(ScreenUtil.bottomBarHeight); //底部安全区距离,适用于全面屏下面有按键的 46 print(ScreenUtil.bottomBarHeight); //底部安全区距离,适用于全面屏下面有按键的