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
李卓原
2023-05-15 13:35:07 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e866c3a13a916b526124cfb2cadad6f3b5b463b4
e866c3a1
1 parent
1359f647
代码优化
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
8 deletions
example/lib/src/first_method.dart
example/lib/src/home.dart
example/lib/src/second_method.dart
example/lib/src_zh/first_method.dart
example/lib/src_zh/second_method.dart
example/lib/src/first_method.dart
View file @
e866c3a
...
...
@@ -13,12 +13,13 @@ class MyApp extends StatelessWidget {
builder:
(
_
,
child
)
{
return
MaterialApp
(
debugShowCheckedModeBanner:
false
,
useInheritedMediaQuery:
true
,
title:
'First Method'
,
// You can use the library anywhere in the app even in theme
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
Typography
.
englishLike2018
.
apply
(
fontSizeFactor:
1
.
sp
),
textTheme:
Typography
(
platform:
TargetPlatform
.
iOS
)
.
black
.
apply
(
fontSizeFactor:
1
),
),
home:
child
,
);
...
...
example/lib/src/home.dart
View file @
e866c3a
...
...
@@ -98,7 +98,13 @@ class HomePageScaffold extends StatelessWidget {
return
Dialog
(
child:
Padding
(
padding:
EdgeInsets
.
all
(
12
.
r
),
child:
const
Text
(
'Dialog'
),
child:
Column
(
children:
[
const
Text
(
'Dialog'
),
Spacer
(),
TextField
(),
],
),
),
);
},
...
...
@@ -124,7 +130,8 @@ class HomePageScaffold extends StatelessWidget {
context:
context
,
builder:
(
BuildContext
context
)
{
return
Container
(
height:
200
.
w
,
height:
200
.
w
+
MediaQuery
.
of
(
context
).
viewInsets
.
bottom
,
color:
Colors
.
amber
,
child:
Center
(
child:
Column
(
...
...
@@ -132,10 +139,16 @@ class HomePageScaffold extends StatelessWidget {
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
const
Text
(
'Modal BottomSheet'
),
Spacer
(),
TextField
(),
ElevatedButton
(
child:
const
Text
(
'Close BottomSheet'
),
onPressed:
Navigator
.
of
(
context
).
pop
,
)
),
SizedBox
(
height:
MediaQuery
.
of
(
context
)
.
viewInsets
.
bottom
),
],
),
),
...
...
example/lib/src/second_method.dart
View file @
e866c3a
...
...
@@ -61,7 +61,7 @@ class MyThemedApp extends StatelessWidget {
return
Theme
(
data:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
TextTheme
(
body
Text2
:
TextStyle
(
fontSize:
30
.
sp
)),
textTheme:
TextTheme
(
body
Medium
:
TextStyle
(
fontSize:
30
.
sp
)),
),
child:
HomePage
(
title:
'FlutterScreenUtil Demo'
),
);
...
...
example/lib/src_zh/first_method.dart
View file @
e866c3a
...
...
@@ -16,7 +16,7 @@ class MyApp extends StatelessWidget {
// You can use the library anywhere in the app even in theme
theme:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
TextTheme
(
body
Text2
:
TextStyle
(
fontSize:
30
.
sp
)),
textTheme:
TextTheme
(
body
Medium
:
TextStyle
(
fontSize:
30
.
sp
)),
),
home:
child
,
);
...
...
example/lib/src_zh/second_method.dart
View file @
e866c3a
...
...
@@ -60,7 +60,7 @@ class MyThemedApp extends StatelessWidget {
return
Theme
(
data:
ThemeData
(
primarySwatch:
Colors
.
blue
,
textTheme:
TextTheme
(
body
Text2
:
TextStyle
(
fontSize:
30
.
sp
)),
textTheme:
TextTheme
(
body
Medium
:
TextStyle
(
fontSize:
30
.
sp
)),
),
child:
HomePage
(
title:
'第二种方法(带主题)'
),
);
...
...
Please
register
or
login
to post a comment