Commit d998edd3 authored by Ian Hickson's avatar Ian Hickson

Merge pull request #2236 from Hixie/raw-gesture-detector-assert

Fix crash in Block.
parents 6f7ceff0 fcb30719
......@@ -279,22 +279,8 @@ class RawGestureDetectorState extends State<RawGestureDetector> {
/// the gesture detector should be enabled.
void replaceGestureRecognizers(Map<Type, GestureRecognizerFactory> gestures) {
assert(() {
RenderObject renderObject = context.findRenderObject();
if (!config.excludeFromSemantics) {
assert(renderObject is RenderSemanticsGestureHandler);
RenderSemanticsGestureHandler semanticsGestureHandler = renderObject;
renderObject = semanticsGestureHandler.child;
}
assert(renderObject is RenderPointerListener);
RenderPointerListener pointerListener = renderObject;
renderObject = pointerListener.child;
if (!renderObject.debugDoingThisLayout) {
throw new WidgetError(
'replaceGestureRecognizers() can only be called during the layout phase of the GestureDetector\'s nearest descendant RenderObjectWidget.\n'
'In this particular case, that is:\n'
' $renderObject'
);
}
if (!RenderObject.debugDoingLayout)
throw new WidgetError('replaceGestureRecognizers() can only be called during the layout phase.');
return true;
});
_syncAll(gestures);
......
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