Commit f97a125e authored by Adam Barth's avatar Adam Barth

Merge pull request #487 from abarth/fix_menu_crash

Popup menu in Stocks throws exception
parents 2e2aa748 2d824894
...@@ -62,7 +62,8 @@ class _DrawerRoute extends OverlayRoute { ...@@ -62,7 +62,8 @@ class _DrawerRoute extends OverlayRoute {
_DrawerState _state = _DrawerState.showing; _DrawerState _state = _DrawerState.showing;
Widget _build(BuildContext context) { Widget _build(BuildContext context) {
return new _DrawerController( return new RepaintBoundary(
child: new _DrawerController(
key: _drawerKey, key: _drawerKey,
settleDuration: _kBaseSettleDuration, settleDuration: _kBaseSettleDuration,
onClosed: () { onClosed: () {
...@@ -81,6 +82,7 @@ class _DrawerRoute extends OverlayRoute { ...@@ -81,6 +82,7 @@ class _DrawerRoute extends OverlayRoute {
} }
}, },
child: new _Drawer(route: this) child: new _Drawer(route: this)
)
); );
} }
...@@ -202,7 +204,7 @@ class _DrawerControllerState extends State<_DrawerController> { ...@@ -202,7 +204,7 @@ class _DrawerControllerState extends State<_DrawerController> {
widthFactor: _performance.progress, widthFactor: _performance.progress,
child: new SizeObserver( child: new SizeObserver(
onSizeChanged: _handleSizeChanged, onSizeChanged: _handleSizeChanged,
child: new ForcedLayer( child: new RepaintBoundary(
child: config.child child: config.child
) )
) )
......
...@@ -1061,7 +1061,7 @@ class RenderPointerListener extends RenderProxyBox { ...@@ -1061,7 +1061,7 @@ class RenderPointerListener extends RenderProxyBox {
/// previously. Similarly, when the child repaints but the surround tree does /// previously. Similarly, when the child repaints but the surround tree does
/// not, we can re-record its display list without re-recording the display list /// not, we can re-record its display list without re-recording the display list
/// for the surround tree. /// for the surround tree.
class RenderForcedLayer extends RenderProxyBox { class RenderRepaintBoundary extends RenderProxyBox {
bool get hasLayer => true; bool get hasLayer => true;
} }
......
...@@ -1337,9 +1337,9 @@ class Listener extends OneChildRenderObjectWidget { ...@@ -1337,9 +1337,9 @@ class Listener extends OneChildRenderObjectWidget {
} }
} }
class ForcedLayer extends OneChildRenderObjectWidget { class RepaintBoundary extends OneChildRenderObjectWidget {
ForcedLayer({ Key key, Widget child }) : super(key: key, child: child); RepaintBoundary({ Key key, Widget child }) : super(key: key, child: child);
RenderForcedLayer createRenderObject() => new RenderForcedLayer(); RenderRepaintBoundary createRenderObject() => new RenderRepaintBoundary();
} }
class IgnorePointer extends OneChildRenderObjectWidget { class IgnorePointer extends OneChildRenderObjectWidget {
......
...@@ -39,9 +39,7 @@ abstract class OverlayRoute extends Route { ...@@ -39,9 +39,7 @@ abstract class OverlayRoute extends Route {
void didPush(OverlayState overlay, OverlayEntry insertionPoint) { void didPush(OverlayState overlay, OverlayEntry insertionPoint) {
for (WidgetBuilder builder in builders) { for (WidgetBuilder builder in builders) {
_overlayEntries.add(new OverlayEntry(builder: (BuildContext context) { _overlayEntries.add(new OverlayEntry(builder: builder));
return new ForcedLayer(child: builder(context));
}));
overlay?.insert(_overlayEntries.last, above: insertionPoint); overlay?.insert(_overlayEntries.last, above: insertionPoint);
insertionPoint = _overlayEntries.last; insertionPoint = _overlayEntries.last;
} }
...@@ -170,6 +168,7 @@ class _ModalScope extends StatusTransitionComponent { ...@@ -170,6 +168,7 @@ class _ModalScope extends StatusTransitionComponent {
) )
); );
} }
contents = new RepaintBoundary(child: contents);
ModalPosition position = route.position; ModalPosition position = route.position;
if (position == null) if (position == null)
return contents; return contents;
......
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