Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
c7369a40
Commit
c7369a40
authored
Sep 27, 2016
by
Adam Barth
Committed by
GitHub
Sep 27, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make the floating action button respond to tap (#6095)
Fixes #6053
parent
0734edbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
persistent_bottom_sheet_demo.dart
...lutter_gallery/lib/demo/persistent_bottom_sheet_demo.dart
+19
-4
No files found.
examples/flutter_gallery/lib/demo/persistent_bottom_sheet_demo.dart
View file @
c7369a40
...
...
@@ -19,11 +19,11 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
@override
void
initState
()
{
super
.
initState
();
_showBottomSheetCallback
=
showBottomSheet
;
_showBottomSheetCallback
=
_
showBottomSheet
;
}
void
showBottomSheet
()
{
void
_
showBottomSheet
()
{
setState
(()
{
// disable the button
_showBottomSheetCallback
=
null
;
});
...
...
@@ -47,18 +47,33 @@ class _PersistentBottomSheetDemoState extends State<PersistentBottomSheetDemo> {
})
.
closed
.
then
((
_
)
{
setState
(()
{
// re-enable the button
_showBottomSheetCallback
=
showBottomSheet
;
_showBottomSheetCallback
=
_
showBottomSheet
;
});
});
}
void
_showMessage
()
{
showDialog
(
context:
context
,
child:
new
Dialog
(
content:
new
Text
(
'You tapped the floating action button.'
),
actions:
<
Widget
>[
new
FlatButton
(
onPressed:
()
{
Navigator
.
of
(
context
).
pop
();
},
child:
new
Text
(
'OK'
)
)
]
)
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
new
Scaffold
(
key:
_scaffoldKey
,
appBar:
new
AppBar
(
title:
new
Text
(
'Persistent bottom sheet'
)),
floatingActionButton:
new
FloatingActionButton
(
onPressed:
null
,
onPressed:
_showMessage
,
backgroundColor:
Colors
.
redAccent
[
200
],
child:
new
Icon
(
Icons
.
add
)
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment