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
Mounir-Bouaiche
2022-05-14 20:52:19 +0100
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a52a21ebd115076eb98d1bd2c6df8cedd0383fe8
a52a21eb
1 parent
29a3c553
Update example to use and test bottomsheet
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
example/lib/src/first_method.dart
example/lib/src/home.dart
example/lib/src/first_method.dart
View file @
a52a21e
...
...
@@ -11,6 +11,7 @@ class MyApp extends StatelessWidget {
return
ScreenUtilInit
(
builder:
(
child
)
{
return
MaterialApp
(
key:
const
GlobalObjectKey
(
'screen-util'
),
debugShowCheckedModeBanner:
false
,
title:
'First Method'
,
// You can use the library anywhere in the app even in theme
...
...
example/lib/src/home.dart
View file @
a52a21e
...
...
@@ -93,6 +93,64 @@ class HomePageScaffold extends StatelessWidget {
),
),
18
.
verticalSpace
,
ElevatedButton
(
onPressed:
()
{
showDialog
(
context:
context
,
builder:
(
_
)
{
return
Dialog
(
child:
Padding
(
padding:
EdgeInsets
.
all
(
12
.
r
),
child:
const
Text
(
'Dialog'
),
),
);
},
);
},
child:
const
Text
(
'Show Dialog'
),
),
18
.
verticalSpace
,
ElevatedButton
(
onPressed:
()
{
Navigator
.
of
(
context
).
push
(
MaterialPageRoute
(
builder:
(
context
)
{
return
ScreenUtilInit
(
builder:
(
context
)
{
return
HomePageScaffold
(
title:
title
);
});
}),
);
},
child:
const
Text
(
'Go to next page'
),
),
18
.
verticalSpace
,
ElevatedButton
(
onPressed:
()
{
showModalBottomSheet
<
void
>(
context:
context
,
builder:
(
BuildContext
context
)
{
return
Container
(
height:
200
.
w
,
color:
Colors
.
amber
,
child:
Center
(
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
mainAxisSize:
MainAxisSize
.
min
,
children:
<
Widget
>[
const
Text
(
'Modal BottomSheet'
),
ElevatedButton
(
child:
const
Text
(
'Close BottomSheet'
),
onPressed:
Navigator
.
of
(
context
).
pop
,
)
],
),
),
);
},
);
},
child:
const
Text
(
'Open BottomSheet'
),
),
18
.
verticalSpace
,
Text
(
'Device width:
${ScreenUtil().screenWidth}
dp'
),
Text
(
'Device height:
${ScreenUtil().screenHeight}
dp'
),
Text
(
'Device pixel density:
${ScreenUtil().pixelRatio}
'
),
...
...
Please
register
or
login
to post a comment