ScrollList.builder constructor

ScrollList.builder({
  1. Key? key,
  2. bool reverse = false,
  3. bool shrinkWrap = false,
  4. bool noScrollBehavior = false,
  5. bool? primary,
  6. Axis scrollDirection = Axis.vertical,
  7. Clip clipBehavior = Clip.hardEdge,
  8. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  9. String? restorationId,
  10. double? cacheExtent,
  11. ScrollPhysics? physics,
  12. EdgeInsetsGeometry? padding,
  13. RefreshConfig? refreshConfig,
  14. ScrollController? controller,
  15. ChildIndexGetter? findChildIndexCallback,
  16. SemanticIndexCallback semanticIndexCallback = kDefaultSemanticIndexCallback,
  17. bool addAutomaticKeepALives = true,
  18. bool addRepaintBoundaries = true,
  19. bool addSemanticIndexes = true,
  20. GridStyle gridStyle = GridStyle.none,
  21. required IndexedWidgetBuilder itemBuilder,
  22. IndexedWidgetBuilder? separatorBuilder,
  23. int? itemCount,
  24. double? itemExtent,
  25. Widget? prototypeItem,
  26. int crossAxisCount = 1,
  27. double? maxCrossAxisExtent,
  28. double mainAxisSpacing = 0,
  29. double crossAxisSpacing = 0,
  30. double childAspectRatio = 1,
  31. double? mainAxisExtent,
  32. Widget placeholder = const PlaceholderChild(),
  33. Widget? header,
  34. Widget? footer,
})

Implementation

ScrollList.builder({
  super.key,
  super.reverse = false,
  super.shrinkWrap = false,
  super.noScrollBehavior = false,
  super.primary,
  super.scrollDirection = Axis.vertical,
  super.clipBehavior = Clip.hardEdge,
  super.dragStartBehavior = DragStartBehavior.start,
  super.restorationId,
  super.cacheExtent,
  super.physics,
  super.padding,
  super.refreshConfig,
  super.controller,
  ChildIndexGetter? findChildIndexCallback,
  SemanticIndexCallback semanticIndexCallback = kDefaultSemanticIndexCallback,
  bool addAutomaticKeepALives = true,
  bool addRepaintBoundaries = true,
  bool addSemanticIndexes = true,
  GridStyle gridStyle = GridStyle.none,
  required IndexedWidgetBuilder itemBuilder,
  IndexedWidgetBuilder? separatorBuilder,
  int? itemCount,

  /// use [SliverFixedExtentList]、[itemExtent] 优先 [prototypeItem]
  double? itemExtent,

  /// use [SliverPrototypeExtentList]、[itemExtent] 优先 [prototypeItem]
  Widget? prototypeItem,

  /// 横轴子元素的数量 自适应最大像素
  /// use [SliverGridDelegateWithFixedCrossAxisCount] or [SliverSimpleGridDelegateWithFixedCrossAxisCount]
  int crossAxisCount = 1,

  /// 横轴元素最大像素 自适应列数
  /// use [SliverGridDelegateWithMaxCrossAxisExtent] or [SliverSimpleGridDelegateWithMaxCrossAxisExtent]
  double? maxCrossAxisExtent,

  /// 主轴方向子元素的间距
  double mainAxisSpacing = 0,

  /// 横轴方向子元素的间距
  double crossAxisSpacing = 0,

  /// 子元素在横轴长度和主轴长度的比例
  double childAspectRatio = 1,

  /// 子元素在主轴上的长度。[mainAxisExtent] 优先 [childAspectRatio]
  double? mainAxisExtent,
  Widget placeholder = const PlaceholderChild(),
  this.header,
  this.footer,
}) : sliver = [
        SliverListGrid.builder(
            placeholder: placeholder,
            mainAxisExtent: mainAxisExtent,
            maxCrossAxisExtent: maxCrossAxisExtent,
            childAspectRatio: childAspectRatio,
            crossAxisCount: crossAxisCount,
            mainAxisSpacing: mainAxisSpacing,
            crossAxisSpacing: crossAxisSpacing,
            addSemanticIndexes: addSemanticIndexes,
            addRepaintBoundaries: addRepaintBoundaries,
            addAutomaticKeepALives: addAutomaticKeepALives,
            findChildIndexCallback: findChildIndexCallback,
            semanticIndexCallback: semanticIndexCallback,
            gridStyle: gridStyle,
            itemBuilder: itemBuilder,
            separatorBuilder: separatorBuilder,
            itemCount: itemCount,
            itemExtent: itemExtent,
            prototypeItem: prototypeItem)
      ];