getIntrinsicHeight method

  1. @override
int getIntrinsicHeight(
  1. int width
)
override

Computes the intrinsic height of this widget under the given width constraint.

Implementation

@override
int getIntrinsicHeight(int width) {
  return runZoned(() {
    final element = LayoutBuilderElement(this);
    element.mount(null);
    element.layout(
      BoxConstraints(
        minWidth: width,
        maxWidth: width,
        minHeight: 0,
        maxHeight: BoxConstraints.infinity,
      ),
    );
    final h = element._child?.widget.getIntrinsicHeight(width) ?? 0;
    element.unmount();
    return h;
  }, zoneValues: {#isMeasuringIntrinsics: true});
}