BaseList.count constructor

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

Implementation

BaseList.count({
  super.key,
  required super.children,
  EasyRefreshController? refreshController,
  Widget? placeholder,
  Widget? header,
  Widget? footer,
  VoidCallback? onRefresh,
  VoidCallback? onLoading,
  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.physics,
  super.padding,
  super.controller,
  super.semanticIndexCallback = kDefaultSemanticIndexCallback,
  super.addAutomaticKeepALives = true,
  super.addRepaintBoundaries = true,
  super.addSemanticIndexes = true,
  super.gridStyle = GridStyle.none,
  super.cacheExtent,

  /// use [SliverFixedExtentList]、[itemExtent] 优先 [prototypeItem]
  super.itemExtent,

  /// use [SliverPrototypeExtentList]、[itemExtent] 优先 [prototypeItem]
  super.prototypeItem,

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

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

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

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

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

  /// 子元素在主轴上的长度。[mainAxisExtent] 优先 [childAspectRatio]
  super.mainAxisExtent,
  RefreshConfig? refreshConfig,
}) : super.count(
          header: header?.toSliverBox,
          footer: footer?.toSliverBox,
          refreshConfig: refreshConfig ??
              ((onRefresh != null || onLoading != null)
                  ? RefreshConfig(
                      controller: refreshController,
                      header: Global().config.pullDownHeader,
                      footer: Global().config.pullUpFooter,
                      onLoading: onLoading == null
                          ? null
                          : () async => onLoading.call(),
                      onRefresh: onRefresh == null
                          ? null
                          : () async => onRefresh.call())
                  : null),
          placeholder: placeholder ?? Global().config.placeholder);