Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
LiZhuoyuan
2021-04-16 00:06:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5916118cf6aafe0cb135c3aff96d49e4796a7648
5916118c
1 parent
2b88799b
fix #244
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
9 deletions
README.md
README_CN.md
README_PT.md
example/README.md
README.md
View file @
5916118
...
...
@@ -203,7 +203,7 @@ Column(
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
ScreenUtil
()
.
setSp
(
24
,
allowFontScalingSelf:
true
))),
.
setSp
(
24
))),
],
)
```
...
...
README_CN.md
View file @
5916118
...
...
@@ -55,7 +55,6 @@ class MyApp extends StatelessWidget {
//填入设计稿中设备的屏幕尺寸,单位dp
return
ScreenUtilInit
(
designSize:
Size
(
360
,
690
),
allowFontScaling:
false
,
builder:
()
=>
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter_ScreenUtil'
,
...
...
@@ -188,7 +187,7 @@ height:200.h
传入设计稿的字体大小:
```
dart
//传入字体大小(单位和初始化时的单位保持一致)
,默认不根据系统的“字体大小”辅助选项来进行缩放(可在初始化ScreenUtil时设置allowFontScaling)
//传入字体大小(单位和初始化时的单位保持一致)
ScreenUtil
().
setSp
(
28
)
或
28
.
sp
(
dart
sdk
>=
2.6
)
...
...
@@ -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
)),
],
)
```
...
...
README_PT.md
View file @
5916118
...
...
@@ -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();
}
...
...
@@ -203,7 +202,7 @@ Column(
style:
TextStyle
(
color:
Colors
.
black
,
fontSize:
ScreenUtil
()
.
setSp
(
24
,
allowFontScalingSelf:
true
))),
.
setSp
(
24
))),
],
)
```
...
...
example/README.md
View file @
5916118
...
...
@@ -126,7 +126,6 @@ class _ExampleWidgetState extends State<ExampleWidget> {
onPressed:
()
{
ScreenUtil
.
init
(
designSize:
Size
(
1500
,
1334
),
allowFontScaling:
false
,
);
setState
(()
{});
},
...
...
Please
register
or
login
to post a comment