Showing
1 changed file
with
5 additions
and
2 deletions
@@ -44,7 +44,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -44,7 +44,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
44 | ### 使用: | 44 | ### 使用: |
45 | 45 | ||
46 | 适配尺寸: | 46 | 适配尺寸: |
47 | -``` | 47 | + |
48 | //传入设计稿的px尺寸: | 48 | //传入设计稿的px尺寸: |
49 | 根据款第适配 width: ScreenUtil().setWidth(540), | 49 | 根据款第适配 width: ScreenUtil().setWidth(540), |
50 | 根据高度适配 height: ScreenUtil().setHeight(200), | 50 | 根据高度适配 height: ScreenUtil().setHeight(200), |
@@ -55,12 +55,15 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -55,12 +55,15 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
55 | setHeight方法主要是在高度上进行适配, 在你想控制UI上一屏的高度与实际中显示一样时使用. | 55 | setHeight方法主要是在高度上进行适配, 在你想控制UI上一屏的高度与实际中显示一样时使用. |
56 | 56 | ||
57 | 例如: | 57 | 例如: |
58 | + | ||
59 | +``` | ||
60 | +//长方形: | ||
58 | Container( | 61 | Container( |
59 | width: ScreenUtil().setWidth(375), | 62 | width: ScreenUtil().setWidth(375), |
60 | height: ScreenUtil().setHeight(200), | 63 | height: ScreenUtil().setHeight(200), |
61 | ), | 64 | ), |
62 | 65 | ||
63 | -如果你想显示一个正方形: | 66 | +//如果你想显示一个正方形: |
64 | Container( | 67 | Container( |
65 | width: ScreenUtil().setWidth(300), | 68 | width: ScreenUtil().setWidth(300), |
66 | height: ScreenUtil().setWidth(300), | 69 | height: ScreenUtil().setWidth(300), |
-
Please register or login to post a comment