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
李卓原
2022-01-12 18:03:20 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
c49a5fcb37941aadf27254f215bb3b2187149f19
c49a5fcb
1 parent
69d6e292
5.0.4 readme
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
32 deletions
CHANGELOG.md
README.md
README_CN.md
README_PT.md
CHANGELOG.md
View file @
c49a5fc
# 5.0.4
-
add setContext() , the first initialization method requires calling
-
fix # 310
-
update ReadMe.md
# 5.0.3
...
...
README.md
View file @
c49a5fc
...
...
@@ -92,16 +92,26 @@ class MyApp extends StatelessWidget {
return
ScreenUtilInit
(
designSize:
Size
(
360
,
690
),
minTextAdapt:
true
,
builder:
()
=>
MaterialApp
(
...
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
TextTheme
(
//To support the following, you need to use the first initialization method
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
splitScreenMode:
true
,
builder:
()
=>
MaterialApp
(
//... other code
builder:
(
context
,
widget
)
{
//add this line
ScreenUtil
.
setContext
(
context
);
return
MediaQuery
(
//Setting font does not change with system font size
data:
MediaQuery
.
of
(
context
).
copyWith
(
textScaleFactor:
1.0
),
child:
widget
,
);
},
theme:
ThemeData
(
textTheme:
TextTheme
(
//To support the following, you need to use the first initialization method
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
);
}
}
...
...
@@ -156,6 +166,7 @@ class _HomePageState extends State<HomePage> {
maxWidth:
MediaQuery
.
of
(
context
).
size
.
width
,
maxHeight:
MediaQuery
.
of
(
context
).
size
.
height
),
designSize:
Size
(
360
,
690
),
context:
context
,
minTextAdapt:
true
,
orientation:
Orientation
.
portrait
);
return
Scaffold
();
...
...
README_CN.md
View file @
c49a5fc
...
...
@@ -63,18 +63,26 @@ class MyApp extends StatelessWidget {
return
ScreenUtilInit
(
designSize:
Size
(
360
,
690
),
minTextAdapt:
true
,
builder:
()
=>
MaterialApp
(
debugShowCheckedModeBanner:
false
,
title:
'Flutter_ScreenUtil'
,
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
//要支持下面这个需要使用第一种初始化方式
textTheme:
TextTheme
(
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
home:
HomePage
(
title:
'FlutterScreenUtil Demo'
),
),
splitScreenMode:
true
,
builder:
()
=>
MaterialApp
(
//... other code
builder:
(
context
,
widget
)
{
//add this line
ScreenUtil
.
setContext
(
context
);
return
MediaQuery
(
//Setting font does not change with system font size
data:
MediaQuery
.
of
(
context
).
copyWith
(
textScaleFactor:
1.0
),
child:
widget
,
);
},
theme:
ThemeData
(
textTheme:
TextTheme
(
//要支持下面这个需要使用第一种初始化方式
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
);
}
}
...
...
@@ -118,6 +126,7 @@ class _HomePageState extends State<HomePage> {
maxWidth: MediaQuery.of(context).size.width,
maxHeight: MediaQuery.of(context).size.height),
designSize: Size(360, 690),
context: context,
minTextAdapt: true,
orientation: Orientation.portrait);
return Scaffold();
...
...
README_PT.md
View file @
c49a5fc
...
...
@@ -59,16 +59,26 @@ class MyApp extends StatelessWidget {
return
ScreenUtilInit
(
designSize:
Size
(
360
,
690
),
minTextAdapt:
true
,
builder:
()
=>
MaterialApp
(
...
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
//To support the following, you need to use the first initialization method
textTheme:
TextTheme
(
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
splitScreenMode:
true
,
builder:
()
=>
MaterialApp
(
//... other code
builder:
(
context
,
widget
)
{
//add this line
ScreenUtil
.
setContext
(
context
);
return
MediaQuery
(
//Setting font does not change with system font size
data:
MediaQuery
.
of
(
context
).
copyWith
(
textScaleFactor:
1.0
),
child:
widget
,
);
},
theme:
ThemeData
(
textTheme:
TextTheme
(
//To support the following, you need to use the first initialization method
button:
TextStyle
(
fontSize:
45
.
sp
)
),
),
),
);
}
}
...
...
@@ -108,6 +118,7 @@ class _HomePageState extends State<HomePage> {
maxWidth: MediaQuery.of(context).size.width,
maxHeight: MediaQuery.of(context).size.height),
designSize: Size(360, 690),
context: context,
orientation: Orientation.portrait);
return Scaffold();
}
...
...
Please
register
or
login
to post a comment