Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lizhuoyuan committed Apr 15, 2021
1 parent 2b88799 commit 5916118
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ Column(
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil()
.setSp(24, allowFontScalingSelf: true))),
.setSp(24))),
],
)
```
Expand Down
8 changes: 3 additions & 5 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class MyApp extends StatelessWidget {
//填入设计稿中设备的屏幕尺寸,单位dp
return ScreenUtilInit(
designSize: Size(360, 690),
allowFontScaling: false,
builder: () => MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Flutter_ScreenUtil',
Expand Down Expand Up @@ -188,7 +187,7 @@ height:200.h
传入设计稿的字体大小:

```dart
//传入字体大小(单位和初始化时的单位保持一致),默认不根据系统的“字体大小”辅助选项来进行缩放(可在初始化ScreenUtil时设置allowFontScaling)
//传入字体大小(单位和初始化时的单位保持一致)
ScreenUtil().setSp(28)
28.sp (dart sdk>=2.6)
Expand All @@ -201,13 +200,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)),
],
)
```
Expand Down
3 changes: 1 addition & 2 deletions README_PT.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,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();
}
Expand Down Expand Up @@ -203,7 +202,7 @@ Column(
style: TextStyle(
color: Colors.black,
fontSize: ScreenUtil()
.setSp(24, allowFontScalingSelf: true))),
.setSp(24))),
],
)
```
Expand Down
1 change: 0 additions & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class _ExampleWidgetState extends State<ExampleWidget> {
onPressed: () {
ScreenUtil.init(
designSize: Size(1500, 1334),
allowFontScaling: false,
);
setState(() {});
},
Expand Down

0 comments on commit 5916118

Please sign in to comment.