getIntrinsicHeight method

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

Returns the intrinsic height of this element.

Implementation

@override
int getIntrinsicHeight(int width) {
  final sb = widget as SizedBox;
  if (sb.height case final h? when h < BoxConstraints.infinity) return h;
  final childWidth = switch (sb.width) {
    final w? when w < BoxConstraints.infinity => w,
    _ => width,
  };
  return childElement?.getIntrinsicHeight(childWidth) ?? 0;
}