Skip to content

Commit 8781b54

Browse files
committed
readme
1 parent 7167e08 commit 8781b54

File tree

3 files changed

+25
-8
lines changed

3 files changed

+25
-8
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,14 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
4747
### Initialize and set the fit size and font size to scale according to the system's "font size" accessibility option
4848
Please set the size of the design draft before use, the width and height of the design draft (unit px).
4949

50+
```
5051
51-
```dart
52+
void main() {
53+
WidgetsFlutterBinding.ensureInitialized();
54+
//Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 ​​(iPhone6 ​​750*1334)
55+
ScreenUtil.init(designSize: Size(750, 1334), allowFontScaling: false);
56+
runApp(MyApp());
57+
}
5258
5359
//fill in the screen size of the device in the design
5460

README_CN.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,21 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
5656

5757
```
5858
//填入设计稿中设备的屏幕尺寸
59+
void main() {
60+
WidgetsFlutterBinding.ensureInitialized();
61+
//设置适配尺寸 (填入设计稿中设备的屏幕尺寸) 此处假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
62+
ScreenUtil.init(designSize: Size(750, 1334), allowFontScaling: false);
63+
runApp(MyApp());
64+
}
5965
6066
//默认 width : 1080px , height:1920px , allowFontScaling:false
61-
ScreenUtil.init(context);
67+
ScreenUtil.init();
6268
6369
//假如设计稿是按iPhone6的尺寸设计的(iPhone6 750*1334)
64-
ScreenUtil.init(context, width: 750, height: 1334);
70+
ScreenUtil.init(designSize: Size(750, 1334));
6571
6672
//设置字体大小根据系统的“字体大小”辅助选项来进行缩放,默认为false
67-
ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: true);
73+
ScreenUtil.init(designSize: Size(750, 1334), allowFontScaling: true);
6874
6975
```
7076

README_PT.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,22 @@ Por favor, defina a largura e altura do protótipo de design antes de usar (em p
4747
Certifique-se de definir as dimensões na paginal inicial do MaterialApp (ou seja, no arquivo de entrada, defina apenas uma vez) para garantir que o tamanho de ajuste seja o mesmo antes de cada uso:
4848

4949
```dart
50-
5150
//Preencha o tamanho da tela do dispositivo no protótipo de design
51+
void main() {
52+
WidgetsFlutterBinding.ensureInitialized();
53+
//Set the fit size (fill in the screen size of the device in the design) If the design is based on the size of the iPhone6 ​​(iPhone6 ​​750*1334)
54+
ScreenUtil.init(designSize: Size(750, 1334), allowFontScaling: false);
55+
runApp(MyApp());
56+
}
5257
5358
//Valor padrão: width : 1080px , height:1920px , allowFontScaling:false
54-
ScreenUtil.init(context);
59+
ScreenUtil.init();
5560
5661
//Se o design é baseado no iPhone6 ​​(iPhone6 ​​750*1334)
57-
ScreenUtil.init(context, width: 750, height: 1334);
62+
ScreenUtil.init(designSize: Size(750, 1334));
5863
5964
//Se você quer definir que o tamanho da fonte seja ajustado de acordo com a opção "tamanho da fonte" na acessibilidade do sistema
60-
ScreenUtil.init(context, width: 750, height: 1334, allowFontScaling: true);
65+
ScreenUtil.init(designSize: Size(750, 1334), allowFontScaling: true);
6166
6267
```
6368

0 commit comments

Comments
 (0)