computeMaxIntrinsicWidth method

  1. @override
double computeMaxIntrinsicWidth(
  1. double height
)
override

The paragraph's own greatest width, which is the GREEDY one: balancing says nothing about intrinsic sizing (css-text-4 8.2).

Implementation

@override
double computeMaxIntrinsicWidth(double height) {
  final p = _paragraph();
  if (p == null) return guardedSize(child, () => super.computeMaxIntrinsicWidth(height));
  _sync(p);
  if (_plain(_source) == null) return guardedSize(child, () => super.computeMaxIntrinsicWidth(height));
  final painter = _painter(p, _source!);
  try {
    painter.layout(maxWidth: double.infinity);
    return painter.maxIntrinsicWidth;
  } finally {
    painter.dispose();
  }
}