Showing
1 changed file
with
6 additions
and
6 deletions
| @@ -41,7 +41,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -41,7 +41,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 41 | Please set the width and height of the design draft before use, the width and height of the design draft (unit px). | 41 | Please set the width and height of the design draft before use, the width and height of the design draft (unit px). |
| 42 | Be sure to set the page in the MaterialApp's home(ie the entry file, just set it once) to ensure that the fit size is set before each use: | 42 | Be sure to set the page in the MaterialApp's home(ie the entry file, just set it once) to ensure that the fit size is set before each use: |
| 43 | 43 | ||
| 44 | -``` | 44 | +```dart |
| 45 | 45 | ||
| 46 | //fill in the screen size of the device in the design | 46 | //fill in the screen size of the device in the design |
| 47 | 47 | ||
| @@ -75,7 +75,7 @@ Height is also adapted according to setWidth to ensure no deformation (when you | @@ -75,7 +75,7 @@ Height is also adapted according to setWidth to ensure no deformation (when you | ||
| 75 | 75 | ||
| 76 | setHeight method is mainly adapted in height, you want to control the height and actuality of a screen on the UIUsed when the same is displayed. | 76 | setHeight method is mainly adapted in height, you want to control the height and actuality of a screen on the UIUsed when the same is displayed. |
| 77 | 77 | ||
| 78 | -``` | 78 | +```dart |
| 79 | //for example: | 79 | //for example: |
| 80 | //rectangle | 80 | //rectangle |
| 81 | Container( | 81 | Container( |
| @@ -93,7 +93,7 @@ Container( | @@ -93,7 +93,7 @@ Container( | ||
| 93 | ``` | 93 | ``` |
| 94 | 94 | ||
| 95 | #### Adapter font: | 95 | #### Adapter font: |
| 96 | -``` | 96 | +``` dart |
| 97 | //Incoming font size,the unit is pixel, fonts will not scale to respect Text Size accessibility settings | 97 | //Incoming font size,the unit is pixel, fonts will not scale to respect Text Size accessibility settings |
| 98 | //(AllowallowFontScaling when initializing ScreenUtil) | 98 | //(AllowallowFontScaling when initializing ScreenUtil) |
| 99 | ScreenUtil.getInstance().setSp(28) | 99 | ScreenUtil.getInstance().setSp(28) |
| @@ -126,7 +126,7 @@ Column( | @@ -126,7 +126,7 @@ Column( | ||
| 126 | ``` | 126 | ``` |
| 127 | 127 | ||
| 128 | #### Other related apis: | 128 | #### Other related apis: |
| 129 | -``` | 129 | +```dart |
| 130 | ScreenUtil.pixelRatio //Device pixel density | 130 | ScreenUtil.pixelRatio //Device pixel density |
| 131 | ScreenUtil.screenWidth //Device width | 131 | ScreenUtil.screenWidth //Device width |
| 132 | ScreenUtil.screenHeight //Device height | 132 | ScreenUtil.screenHeight //Device height |
| @@ -139,11 +139,11 @@ Column( | @@ -139,11 +139,11 @@ Column( | ||
| 139 | 139 | ||
| 140 | ``` | 140 | ``` |
| 141 | 141 | ||
| 142 | -``` | 142 | +```dart |
| 143 | //import | 143 | //import |
| 144 | import 'package:flutter_screenutil/flutter_screenutil.dart'; | 144 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
| 145 | 145 | ||
| 146 | -... | 146 | +...dart |
| 147 | 147 | ||
| 148 | @override | 148 | @override |
| 149 | Widget build(BuildContext context) { | 149 | Widget build(BuildContext context) { |
-
Please register or login to post a comment