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
aef60030
Commit
aef60030
authored
Nov 21, 2015
by
Hixie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a way to insert multiple overlays at once.
parent
630284bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
overlay.dart
packages/flutter/lib/src/widgets/overlay.dart
+12
-0
routes.dart
packages/flutter/lib/src/widgets/routes.dart
+2
-4
No files found.
packages/flutter/lib/src/widgets/overlay.dart
View file @
aef60030
...
...
@@ -66,6 +66,18 @@ class OverlayState extends State<Overlay> {
});
}
void
insertAll
(
Iterable
<
OverlayEntry
>
entries
,
{
OverlayEntry
above
})
{
assert
(
above
==
null
||
(
above
.
_state
==
this
&&
_entries
.
contains
(
above
)));
for
(
OverlayEntry
entry
in
entries
)
{
assert
(
entry
.
_state
==
null
);
entry
.
_state
=
this
;
}
setState
(()
{
int
index
=
above
==
null
?
_entries
.
length
:
_entries
.
indexOf
(
above
)
+
1
;
_entries
.
insertAll
(
index
,
entries
);
});
}
void
_remove
(
OverlayEntry
entry
)
{
setState
(()
{
_entries
.
remove
(
entry
);
...
...
packages/flutter/lib/src/widgets/routes.dart
View file @
aef60030
...
...
@@ -41,11 +41,9 @@ abstract class OverlayRoute<T> extends Route<T> {
final
List
<
OverlayEntry
>
_overlayEntries
=
<
OverlayEntry
>[];
void
didPush
(
OverlayState
overlay
,
OverlayEntry
insertionPoint
)
{
for
(
WidgetBuilder
builder
in
builders
)
{
for
(
WidgetBuilder
builder
in
builders
)
_overlayEntries
.
add
(
new
OverlayEntry
(
builder:
builder
));
overlay
?.
insert
(
_overlayEntries
.
last
,
above:
insertionPoint
);
insertionPoint
=
_overlayEntries
.
last
;
}
overlay
?.
insertAll
(
_overlayEntries
,
above:
insertionPoint
);
}
// Subclasses shouldn't call this if they want to delay the finished() call.
...
...
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