Skip to content

Commit

Permalink
Reland "Prevent LayoutBuilder from rebuilding more than once (#147856…
Browse files Browse the repository at this point in the history
…)" (#149303)

Diff commit: flutter/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.
  • Loading branch information
LongCatIsLooong authored Jun 3, 2024
1 parent 31c8222 commit 8e15e56
Show file tree
Hide file tree
Showing 8 changed files with 714 additions and 248 deletions.
9 changes: 3 additions & 6 deletions packages/flutter/lib/src/rendering/object.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1999,8 +1999,7 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
}

if (!activeLayoutRoot._debugMutationsLocked) {
final RenderObject? p = activeLayoutRoot.debugLayoutParent;
activeLayoutRoot = p is RenderObject ? p : null;
activeLayoutRoot = activeLayoutRoot.debugLayoutParent;
} else {
// activeLayoutRoot found.
break;
Expand Down Expand Up @@ -3004,7 +3003,7 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
owner!._nodesNeedingPaint.add(this);
owner!.requestVisualUpdate();
}
} else if (parent is RenderObject) {
} else if (parent != null) {
parent!.markNeedsPaint();
} else {
assert(() {
Expand All @@ -3020,9 +3019,7 @@ abstract class RenderObject with DiagnosticableTreeMixin implements HitTestTarge
//
// Trees rooted at a RenderView do not go through this
// code path because RenderViews are repaint boundaries.
if (owner != null) {
owner!.requestVisualUpdate();
}
owner?.requestVisualUpdate();
}
}

Expand Down
Loading

0 comments on commit 8e15e56

Please sign in to comment.