Showing
3 changed files
with
8 additions
and
8 deletions
| @@ -65,7 +65,7 @@ class _HomePageState extends State<HomePage> { | @@ -65,7 +65,7 @@ class _HomePageState extends State<HomePage> { | ||
| 65 | // Without using Extensions | 65 | // Without using Extensions |
| 66 | Container( | 66 | Container( |
| 67 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)), | 67 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)), |
| 68 | - width: 180.w, | 68 | + width: ScreenUtil().setWidth(180), |
| 69 | height: ScreenUtil().setHeight(200), | 69 | height: ScreenUtil().setHeight(200), |
| 70 | color: Colors.blue, | 70 | color: Colors.blue, |
| 71 | child: Text( | 71 | child: Text( |
| @@ -47,8 +47,8 @@ class _HomePageState extends State<HomePage> { | @@ -47,8 +47,8 @@ class _HomePageState extends State<HomePage> { | ||
| 47 | children: <Widget>[ | 47 | children: <Widget>[ |
| 48 | Container( | 48 | Container( |
| 49 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)), | 49 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)), |
| 50 | - width: ScreenUtil().setWidth(375), | ||
| 51 | - height: ScreenUtil().setHeight(200), | 50 | + width: 180.w, |
| 51 | + height: 200.h, | ||
| 52 | color: Colors.red, | 52 | color: Colors.red, |
| 53 | child: Text( | 53 | child: Text( |
| 54 | '我的实际宽度:${0.5.sw}dp \n' | 54 | '我的实际宽度:${0.5.sw}dp \n' |
| @@ -58,15 +58,14 @@ class _HomePageState extends State<HomePage> { | @@ -58,15 +58,14 @@ class _HomePageState extends State<HomePage> { | ||
| 58 | ), | 58 | ), |
| 59 | Container( | 59 | Container( |
| 60 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)), | 60 | padding: EdgeInsets.all(ScreenUtil().setWidth(10)), |
| 61 | - width: 180.w, | ||
| 62 | - height: 200.h, | 61 | + width: ScreenUtil().setWidth(180), |
| 62 | + height: ScreenUtil().setHeight(200), | ||
| 63 | color: Colors.blue, | 63 | color: Colors.blue, |
| 64 | child: Text( | 64 | child: Text( |
| 65 | '我的设计稿宽度: 180dp \n' | 65 | '我的设计稿宽度: 180dp \n' |
| 66 | '我的设计稿高度: 200dp', | 66 | '我的设计稿高度: 200dp', |
| 67 | style: TextStyle(color: Colors.white, fontSize: ScreenUtil().setSp(12))), | 67 | style: TextStyle(color: Colors.white, fontSize: ScreenUtil().setSp(12))), |
| 68 | ), | 68 | ), |
| 69 | - | ||
| 70 | ], | 69 | ], |
| 71 | ), | 70 | ), |
| 72 | Container( | 71 | Container( |
| @@ -74,7 +73,8 @@ class _HomePageState extends State<HomePage> { | @@ -74,7 +73,8 @@ class _HomePageState extends State<HomePage> { | ||
| 74 | width: 100.r, | 73 | width: 100.r, |
| 75 | height: 100.r, | 74 | height: 100.r, |
| 76 | color: Colors.green, | 75 | color: Colors.green, |
| 77 | - child: Text('我是正方形,边长是100', | 76 | + child: Text( |
| 77 | + '我是正方形,边长是100', | ||
| 78 | style: TextStyle( | 78 | style: TextStyle( |
| 79 | color: Colors.white, | 79 | color: Colors.white, |
| 80 | fontSize: ScreenUtil().setSp(12), | 80 | fontSize: ScreenUtil().setSp(12), |
-
Please register or login to post a comment