Commit 678a1a37 authored by Chun-Heng Tai's avatar Chun-Heng Tai

fix hero controller

parent 91522c43
......@@ -69,7 +69,6 @@ class ContainerManagerState extends State<BoostContainerManager> {
final List<BoostContainer> _offstage = <BoostContainer>[];
List<_ContainerOverlayEntry> _leastEntries;
BoostContainer _onstage;
bool _foreground = true;
......@@ -158,15 +157,20 @@ class ContainerManagerState extends State<BoostContainerManager> {
}
}
final List<BoostContainer> containers = <BoostContainer>[];
containers.addAll(_offstage);
final List<Widget> containers = <Widget>[];
containers.addAll(_offstage.map<Widget>(
(BoostContainer container) => HeroControllerScope(
controller: null,
child: container
)
));
assert(_onstage != null, 'Should have a least one BoostContainer');
containers.add(_onstage);
_leastEntries = containers
.map<_ContainerOverlayEntry>(
(BoostContainer container) => _ContainerOverlayEntry(container))
(Widget container) => _ContainerOverlayEntry(container))
.toList(growable: false);
overlayState.insertAll(_leastEntries);
......@@ -336,7 +340,7 @@ class ContainerManagerState extends State<BoostContainerManager> {
}
class _ContainerOverlayEntry extends OverlayEntry {
_ContainerOverlayEntry(BoostContainer container)
_ContainerOverlayEntry(Widget container)
: super(
builder: (BuildContext ctx) => container,
opaque: true,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment