Replace RenderBox.compute* with RenderBox.get* and add @visibleForOverriding (#145503)

`@visibleForOverriding` + `@protected` unfortunately does not catch the case where a `compute*` method was overridden in a subtype and the overide was called in that same type's implementation.

I did not add a `flutter_ignore` for this because it doesn't seem there will be false positives.
This commit is contained in:
LongCatIsLooong
2024-03-21 19:44:55 -07:00
committed by GitHub
parent 0f685f88c6
commit d755bc222b
19 changed files with 246 additions and 37 deletions

View File

@@ -242,8 +242,8 @@ class RenderDiagonal extends RenderBox
@override
Size computeDryLayout(BoxConstraints constraints) {
const BoxConstraints childConstraints = BoxConstraints();
final Size topLeftSize = _topLeft?.computeDryLayout(childConstraints) ?? Size.zero;
final Size bottomRightSize = _bottomRight?.computeDryLayout(childConstraints) ?? Size.zero;
final Size topLeftSize = _topLeft?.getDryLayout(childConstraints) ?? Size.zero;
final Size bottomRightSize = _bottomRight?.getDryLayout(childConstraints) ?? Size.zero;
return constraints.constrain(Size(
topLeftSize.width + bottomRightSize.width,
topLeftSize.height + bottomRightSize.height,