From bd30a5faca93fe1279f1d39d347f9dbe8472877b Mon Sep 17 00:00:00 2001 From: Daksh Vasudev <136306675+dakshatsuraasa@users.noreply.github.com> Date: Tue, 10 Jun 2025 17:19:51 +0530 Subject: [PATCH 1/2] fix: support for flutter v3.32.2 --- lib/src/render/layout/layout_builder_baseline.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/src/render/layout/layout_builder_baseline.dart b/lib/src/render/layout/layout_builder_baseline.dart index 672d9c45..01c59959 100644 --- a/lib/src/render/layout/layout_builder_baseline.dart +++ b/lib/src/render/layout/layout_builder_baseline.dart @@ -23,7 +23,6 @@ class LayoutBuilderPreserveBaseline class _RenderLayoutBuilderPreserveBaseline extends RenderBox with RenderObjectWithChildMixin, - RenderObjectWithLayoutCallbackMixin, RenderConstrainedLayoutBuilder { @override double? computeDistanceToActualBaseline(TextBaseline baseline) => @@ -60,7 +59,6 @@ class _RenderLayoutBuilderPreserveBaseline extends RenderBox @override void performLayout() { final constraints = this.constraints; - runLayoutCallback(); if (child != null) { child!.layout(constraints, parentUsesSize: true); size = constraints.constrain(child!.size); From c49b34002ec1f45cfbdecfc15ca05864c035ed61 Mon Sep 17 00:00:00 2001 From: ss0314 Date: Thu, 11 Sep 2025 10:36:06 +0900 Subject: [PATCH 2/2] Fix: Resolve unbounded layout errors in Column/ListView --- lib/src/ast/nodes/left_right.dart | 5 ++++- lib/src/ast/nodes/sqrt.dart | 4 +++- lib/src/render/layout/line.dart | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/src/ast/nodes/left_right.dart b/lib/src/ast/nodes/left_right.dart index 46f6b91c..b33a34dc 100644 --- a/lib/src/ast/nodes/left_right.dart +++ b/lib/src/ast/nodes/left_right.dart @@ -51,6 +51,9 @@ class LeftRightNode extends SlotableNode { // Delimiter return LineElement( customCrossSize: (height, depth) { + if (!height.isFinite || !depth.isFinite) { + return const BoxConstraints(minHeight: 20.0); + } final delta = math.max(height - a, depth + a); final delimeterFullHeight = math.max(delta / 500 * delimiterFactor, 2 * delta - delimiterShorfall.toLpUnder(options)); @@ -61,7 +64,7 @@ class LeftRightNode extends SlotableNode { : getSpacingSize(index == 0 ? AtomType.open : AtomType.rel, body[(index + 1) ~/ 2].leftType, options.style) .toLpUnder(options), - child: LayoutBuilderPreserveBaseline( + child: LayoutBuilder( builder: (context, constraints) => buildCustomSizedDelimWidget( index == 0 ? leftDelim diff --git a/lib/src/ast/nodes/sqrt.dart b/lib/src/ast/nodes/sqrt.dart index f0b6d941..e6381205 100644 --- a/lib/src/ast/nodes/sqrt.dart +++ b/lib/src/ast/nodes/sqrt.dart @@ -65,7 +65,7 @@ class SqrtNode extends SlotableNode { // so 'SelectionManagerMixin.getRenderLineAtOffset' can find // render lines in the base widget child: IgnorePointer( - child: LayoutBuilderPreserveBaseline( + child: LayoutBuilder( builder: (context, constraints) => sqrtSvg( minDelimiterHeight: constraints.minHeight, baseWidth: constraints.minWidth, @@ -136,6 +136,7 @@ enum _SqrtPos { class SqrtLayoutDelegate extends CustomLayoutDelegate<_SqrtPos> { final MathOptions options; final MathOptions baseOptions; + // final MathOptions indexOptions; SqrtLayoutDelegate({ @@ -143,6 +144,7 @@ class SqrtLayoutDelegate extends CustomLayoutDelegate<_SqrtPos> { required this.baseOptions, // required this.indexOptions, }); + var heightAboveBaseline = 0.0; var svgHorizontalPos = 0.0; var svgVerticalPos = 0.0; diff --git a/lib/src/render/layout/line.dart b/lib/src/render/layout/line.dart index b4d399e8..d72ae07d 100644 --- a/lib/src/render/layout/line.dart +++ b/lib/src/render/layout/line.dart @@ -19,6 +19,8 @@ class LineParentData extends ContainerBoxParentData { bool alignerOrSpacer = false; + late BoxConstraints constraints; + @override String toString() => '${super.toString()}; canBreakBefore = $canBreakBefore; customSize = ${customCrossSize != null}; trailingMargin = $trailingMargin; alignerOrSpacer = $alignerOrSpacer'; @@ -340,7 +342,7 @@ class RenderLine extends RenderBox } else if (childParentData.alignerOrSpacer) { alignerAndSpacers.add(child); } else { - final childSize = child.getLayoutSize(infiniteConstraint, dry: dry); + final childSize = child.getLayoutSize(constraints.loosen(), dry: dry); sizeMap[child] = childSize; final distance = dry ? 0.0 : child.getDistanceToBaseline(textBaseline)!; maxHeightAboveBaseline = math.max(maxHeightAboveBaseline, distance);