ListComponent constructor

ListComponent({
  1. required List<PositionComponent> children,
  2. required double childHeight,
  3. double? spacing,
  4. double? width,
  5. Vector2? size,
  6. Vector2? position,
})

Creates a ListComponent with the given parameters.

children is the list of child components to arrange. childHeight specifies the height of each child component. spacing specifies the spacing between child components (optional). width specifies the width of the list (optional). size specifies the size of the component. position specifies the position of the component.

Implementation

ListComponent({
  required List<PositionComponent> children,
  required this.childHeight,
  double? spacing,
  double? width,
  super.size,
  super.position,
}) : spacing = spacing ?? 0,
     childrenComponents = children,
     _width = width;