Collection constructor

const Collection({
  1. Key? key,
  2. List<Widget> children = const [],
})

The default constructor for creating a Collection with a static list of child widgets.

This constructor initializes the widget for rendering a fixed set of Widget children. It sets the builder-related fields to null and disables custom builder mode, making it suitable for simple, non-dynamic lists. The children parameter accepts a list of widgets that will be rendered, defaulting to an empty list if not provided.

Example:

Collection(children: [
  Text('Item 1'),
  Text('Item 2'),
])

Implementation

const Collection({super.key, this.children = const []})
    : childCount = null,
      builder = null,
      customBuilder = false;