Showing
2 changed files
with
6 additions
and
2 deletions
@@ -40,10 +40,12 @@ Please set the width and height of the design draft before use, the width and he | @@ -40,10 +40,12 @@ Please set the width and height of the design draft before use, the width and he | ||
40 | 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: | 40 | 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: |
41 | 41 | ||
42 | ``` | 42 | ``` |
43 | + | ||
44 | +//fill in the screen size of the device in the design | ||
45 | + | ||
43 | //default value : width : 1080px , height:1920px , allowFontScaling:false | 46 | //default value : width : 1080px , height:1920px , allowFontScaling:false |
44 | ScreenUtil.instance = ScreenUtil()..init(context); | 47 | ScreenUtil.instance = ScreenUtil()..init(context); |
45 | 48 | ||
46 | -//fill in the screen size of the device in the design | ||
47 | //If the design is based on the size of the iPhone6 (iPhone6 750*1334) | 49 | //If the design is based on the size of the iPhone6 (iPhone6 750*1334) |
48 | ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context); | 50 | ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context); |
49 | 51 |
@@ -45,10 +45,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | @@ -45,10 +45,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
45 | 一定在MaterialApp的home中的页面设置(即入口文件,只需设置一次),以保证在每次使用之前设置好了适配尺寸: | 45 | 一定在MaterialApp的home中的页面设置(即入口文件,只需设置一次),以保证在每次使用之前设置好了适配尺寸: |
46 | 46 | ||
47 | ``` | 47 | ``` |
48 | +//填入设计稿中设备的屏幕尺寸 | ||
49 | + | ||
48 | //默认 width : 1080px , height:1920px , allowFontScaling:false | 50 | //默认 width : 1080px , height:1920px , allowFontScaling:false |
49 | ScreenUtil.instance = ScreenUtil()..init(context); | 51 | ScreenUtil.instance = ScreenUtil()..init(context); |
50 | 52 | ||
51 | -//填入设计稿中设备的屏幕尺寸 , 假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334) | 53 | +//假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334) |
52 | ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context); | 54 | ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context); |
53 | 55 | ||
54 | //设置字体大小根据系统的“字体大小”辅助选项来进行缩放,默认为false : 字体不随着系统的“字体大小”辅助选项来进行缩放 | 56 | //设置字体大小根据系统的“字体大小”辅助选项来进行缩放,默认为false : 字体不随着系统的“字体大小”辅助选项来进行缩放 |
-
Please register or login to post a comment