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
7955995f
Commit
7955995f
authored
Nov 14, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Safely clear SnackBack and BottomSheet placeholders
parent
b6234414
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
bottom_sheet.dart
packages/flutter/lib/src/material/bottom_sheet.dart
+4
-1
snack_bar.dart
packages/flutter/lib/src/material/snack_bar.dart
+8
-1
No files found.
packages/flutter/lib/src/material/bottom_sheet.dart
View file @
7955995f
...
...
@@ -221,6 +221,9 @@ Future showBottomSheet({ BuildContext context, GlobalKey<PlaceholderState> place
placeholderKey
.
currentState
.
child
=
new
_PersistentBottomSheet
(
route:
route
);
Navigator
.
of
(
context
).
pushEphemeral
(
route
);
return
completer
.
future
.
then
((
_
)
{
placeholderKey
.
currentState
.
child
=
null
;
// If our overlay has been obscured by an opaque OverlayEntry then currentState
// will have been cleared already.
if
(
placeholderKey
.
currentState
!=
null
)
placeholderKey
.
currentState
.
child
=
null
;
});
}
packages/flutter/lib/src/material/snack_bar.dart
View file @
7955995f
...
...
@@ -108,9 +108,16 @@ Future showSnackBar({ BuildContext context, GlobalKey<PlaceholderState> placehol
content:
content
,
actions:
actions
);
// TODO(hansmuller): https://github.com/flutter/flutter/issues/374
assert
(
placeholderKey
.
currentState
.
child
==
null
);
placeholderKey
.
currentState
.
child
=
snackBar
;
Navigator
.
of
(
context
).
pushEphemeral
(
route
);
return
completer
.
future
.
then
((
_
)
{
placeholderKey
.
currentState
.
child
=
null
;
// If our overlay has been obscured by an opaque OverlayEntry currentState
// will have been cleared already.
if
(
placeholderKey
.
currentState
!=
null
)
placeholderKey
.
currentState
.
child
=
null
;
});
}
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