inSliverList method

SliverList inSliverList({
  1. void onItemClick(
    1. BuildContext context,
    2. int index
    )?,
  2. int? findChildIndexCallback(
    1. Key
    )?,
  3. int? childCount,
  4. bool addAutomaticKeepAlives = true,
  5. bool addRepaintBoundaries = true,
  6. bool addSemanticIndexes = true,
  7. int semanticIndexOffset = 0,
})

Implementation

SliverList inSliverList({
  void Function(BuildContext context, int index)? onItemClick,
  int? Function(Key)? findChildIndexCallback,
  int? childCount,
  bool addAutomaticKeepAlives = true,
  bool addRepaintBoundaries = true,
  bool addSemanticIndexes = true,
  int semanticIndexOffset = 0,
}) {
  return SliverList(
      delegate: SliverChildBuilderDelegate(
    (context, index) => action(onClick: () => onItemClick?.call(context, index)),
    findChildIndexCallback: findChildIndexCallback,
    childCount: childCount,
    addAutomaticKeepAlives: addAutomaticKeepAlives,
    addRepaintBoundaries: addRepaintBoundaries,
    addSemanticIndexes: addSemanticIndexes,
    semanticIndexOffset: semanticIndexOffset,
  ));
}