computeMinIntrinsicHeight method

  1. @override
double computeMinIntrinsicHeight (double width)

Computes the value returned by getMinIntrinsicHeight. Do not call this function directly, instead, call getMinIntrinsicHeight.

Override in subclasses that implement performLayout. Should return the minimum height that this box could be without failing to correctly paint its contents within itself, without clipping.

If the layout algorithm is independent of the context (e.g. it always tries to be a particular size), or if the layout algorithm is height-in-width-out, or if the layout algorithm uses both the incoming height and width constraints (e.g. it always sizes itself to BoxConstraints.biggest), then the width argument should be ignored.

If the layout algorithm is strictly width-in-height-out, or is width-in-height-out when the height is unconstrained, then the width argument is the width to use.

The width argument will never be negative or null. It may be infinite.

If this algorithm depends on the intrinsic dimensions of a child, the intrinsic dimensions of that child should be obtained using the functions whose names start with get, not compute.

This function should never return a negative or infinite value.

See also examples in the definition of computeMinIntrinsicWidth.


double computeMinIntrinsicHeight(double width) {
  final double height = _getSize(BoxConstraints.tightForFinite(width: width)).height;
  if (height.isFinite)
    return height;
  return 0.0;