intrinsicSize property

  1. @override
Vector2 get intrinsicSize
override

The smallest possible size this component can possibly have, as a container of other components, and given whatever constraints any subclass of LayoutComponent may prescribe.

Implementation

@override
Vector2 get intrinsicSize {
  final childWidth = child?.size.x ?? 0;
  final childHeight = child?.size.y ?? 0;
  return Vector2(
    childWidth + padding.horizontal,
    childHeight + padding.vertical,
  );
}