李卓原

Merge remote-tracking branch 'origin/master'

... ... @@ -206,8 +206,7 @@ Container(
#### Adapter font:
``` dart
//Incoming font size(The unit is the same as the unit at initialization), fonts will not scale to respect Text Size accessibility settings
//(AllowallowFontScaling when initializing ScreenUtil)
//Incoming font size(The unit is the same as the unit at initialization)
ScreenUtil().setSp(28)
28.sp
... ... @@ -226,7 +225,7 @@ Column(
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil()
.setSp(24, allowFontScalingSelf: true))),
.setSp(24))),
],
)
```
... ...
... ... @@ -192,7 +192,7 @@ height:200.h
传入设计稿的字体大小:
```dart
//传入字体大小(单位和初始化时的单位保持一致),默认不根据系统的“字体大小”辅助选项来进行缩放(可在初始化ScreenUtil时设置allowFontScaling)
//传入字体大小(单位和初始化时的单位保持一致)
ScreenUtil().setSp(28)
28.sp (dart sdk>=2.6)
... ... @@ -205,13 +205,12 @@ Column(
Text('我的文字大小在设计稿上是24dp,不会随着系统的文字缩放比例变化',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil().setSp(24),
fontSize: 24.sp,
)),
Text('我的文字大小在设计稿上是24dp,会随着系统的文字缩放比例变化',
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil()
.setSp(24, allowFontScalingSelf: true))),
fontSize: 24.sp)),
],
)
```
... ...
... ... @@ -102,7 +102,6 @@ class _HomePageState extends State<HomePage> {
maxWidth: MediaQuery.of(context).size.width,
maxHeight: MediaQuery.of(context).size.height),
designSize: Size(360, 690),
allowFontScaling: false,
orientation: Orientation.portrait);
return Scaffold();
}
... ... @@ -188,8 +187,8 @@ Container(
#### Adaptar fonte:
``` dart
//Tamanho da fonte informado, em pixels, a fonte não irá dimensionar respeitando a opção "Tamanho de Fonte" nas configurações de acessibilidade
//(allowFontScaling quando iniciar o ScreenUtil)
//Tamanho da fonte informado, em dp
ScreenUtil().setSp(28)
//Tamanho da fonte informado,em pixels,a fonte irá dimensionar respeitando a opção "Tamanho de Fonte" nas configurações de acessibilidade
... ... @@ -211,7 +210,7 @@ Column(
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil()
.setSp(24, allowFontScalingSelf: true))),
.setSp(24))),
],
)
```
... ...
... ... @@ -126,7 +126,6 @@ class _ExampleWidgetState extends State<ExampleWidget> {
onPressed: () {
ScreenUtil.init(
designSize: Size(1500, 1334),
allowFontScaling: false,
);
setState(() {});
},
... ...