Skip to content

Commit bc1c675

Browse files
LongCatIsLooongpull[bot]
authored andcommitted
Reland "Prevent LayoutBuilder from rebuilding more than once (flutter#147856)" (flutter#149303)
Diff commit: flutter@a3f7aca In the failing tests the debugger treated the exception thrown by `Element.rebuild` as a caught exception in the absence of the vm pragma.
1 parent 1688deb commit bc1c675

File tree

8 files changed

+714
-248
lines changed

8 files changed

+714
-248
lines changed

packages/flutter/lib/src/rendering/object.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1999,8 +1999,7 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
19991999
}
20002000

20012001
if (!activeLayoutRoot._debugMutationsLocked) {
2002-
final RenderObject? p = activeLayoutRoot.debugLayoutParent;
2003-
activeLayoutRoot = p is RenderObject ? p : null;
2002+
activeLayoutRoot = activeLayoutRoot.debugLayoutParent;
20042003
} else {
20052004
// activeLayoutRoot found.
20062005
break;
@@ -3004,7 +3003,7 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
30043003
owner!._nodesNeedingPaint.add(this);
30053004
owner!.requestVisualUpdate();
30063005
}
3007-
} else if (parent is RenderObject) {
3006+
} else if (parent != null) {
30083007
parent!.markNeedsPaint();
30093008
} else {
30103009
assert(() {
@@ -3020,9 +3019,7 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
30203019
//
30213020
// Trees rooted at a RenderView do not go through this
30223021
// code path because RenderViews are repaint boundaries.
3023-
if (owner != null) {
3024-
owner!.requestVisualUpdate();
3025-
}
3022+
owner?.requestVisualUpdate();
30263023
}
30273024
}
30283025

0 commit comments

Comments
 (0)