IndexedScrollTag constructor

const IndexedScrollTag({
  1. Key? key,
  2. GlobalKey<State<StatefulWidget>>? scrollKey,
  3. required IndexedScrollController controller,
  4. required int index,
  5. required Widget child,
})

Creates an IndexedScrollTag.

The controller, index, and child parameters are required.

  • key: The widget key (standard Flutter widget key).
  • scrollKey: Optional custom GlobalKey for registration. If not provided, a new key is automatically created. Custom keys are rarely needed.
  • controller: The IndexedScrollController to register with.
  • index: The list index of this item (must be non-negative).
  • child: The actual widget content to be displayed and scrolled to.

Implementation

const IndexedScrollTag({
  super.key,
  this.scrollKey,
  required this.controller,
  required this.index,
  required this.child,
});