maxHeight method

Widget maxHeight(
  1. SizeUnit maxHeight, [
  2. Key? key
])

Sets the maximum height constraint for this widget using a SizeUnit.

The widget will not grow beyond this height, even if the parent container or flex growing would normally make it larger.

The optional key parameter assigns a key to the wrapped widget.

Example:

ScrollableContent().maxHeight(300.size),

Implementation

Widget maxHeight(SizeUnit maxHeight, [Key? key]) {
  return _WidgetWrapper._wrapOrCopyWith(
    child: this,
    key: key != null ? () => key : null,
    maxHeight: () => maxHeight,
  );
}