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> { ...@@ -69,7 +69,6 @@ class ContainerManagerState extends State<BoostContainerManager> {
final List<BoostContainer> _offstage = <BoostContainer>[]; final List<BoostContainer> _offstage = <BoostContainer>[];
List<_ContainerOverlayEntry> _leastEntries; List<_ContainerOverlayEntry> _leastEntries;
BoostContainer _onstage; BoostContainer _onstage;
bool _foreground = true; bool _foreground = true;
...@@ -158,15 +157,20 @@ class ContainerManagerState extends State<BoostContainerManager> { ...@@ -158,15 +157,20 @@ class ContainerManagerState extends State<BoostContainerManager> {
} }
} }
final List<BoostContainer> containers = <BoostContainer>[]; final List<Widget> containers = <Widget>[];
containers.addAll(_offstage); containers.addAll(_offstage.map<Widget>(
(BoostContainer container) => HeroControllerScope(
controller: null,
child: container
)
));
assert(_onstage != null, 'Should have a least one BoostContainer'); assert(_onstage != null, 'Should have a least one BoostContainer');
containers.add(_onstage); containers.add(_onstage);
_leastEntries = containers _leastEntries = containers
.map<_ContainerOverlayEntry>( .map<_ContainerOverlayEntry>(
(BoostContainer container) => _ContainerOverlayEntry(container)) (Widget container) => _ContainerOverlayEntry(container))
.toList(growable: false); .toList(growable: false);
overlayState.insertAll(_leastEntries); overlayState.insertAll(_leastEntries);
...@@ -336,7 +340,7 @@ class ContainerManagerState extends State<BoostContainerManager> { ...@@ -336,7 +340,7 @@ class ContainerManagerState extends State<BoostContainerManager> {
} }
class _ContainerOverlayEntry extends OverlayEntry { class _ContainerOverlayEntry extends OverlayEntry {
_ContainerOverlayEntry(BoostContainer container) _ContainerOverlayEntry(Widget container)
: super( : super(
builder: (BuildContext ctx) => container, builder: (BuildContext ctx) => container,
opaque: true, 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