ScrollList.count constructor
ScrollList.count({
- Key? key,
- bool reverse = false,
- bool shrinkWrap = false,
- bool noScrollBehavior = false,
- bool? primary,
- Axis scrollDirection = Axis.vertical,
- Clip clipBehavior = Clip.hardEdge,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- String? restorationId,
- double? cacheExtent,
- ScrollPhysics? physics,
- EdgeInsetsGeometry? padding,
- RefreshConfig? refreshConfig,
- ScrollController? controller,
- SemanticIndexCallback semanticIndexCallback = kDefaultSemanticIndexCallback,
- bool addAutomaticKeepALives = true,
- bool addRepaintBoundaries = true,
- bool addSemanticIndexes = true,
- GridStyle gridStyle = GridStyle.none,
- required List<
Widget> children, - double? itemExtent,
- Widget? prototypeItem,
- int crossAxisCount = 1,
- double? maxCrossAxisExtent,
- double mainAxisSpacing = 0,
- double crossAxisSpacing = 0,
- double childAspectRatio = 1,
- double? mainAxisExtent,
- Widget placeholder = const PlaceholderChild(),
- Widget? header,
Implementation
ScrollList.count({
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,
SemanticIndexCallback semanticIndexCallback = kDefaultSemanticIndexCallback,
bool addAutomaticKeepALives = true,
bool addRepaintBoundaries = true,
bool addSemanticIndexes = true,
GridStyle gridStyle = GridStyle.none,
required List<Widget> children,
/// 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,
/// 子元素在横轴长度和主轴长度的比例
/// [gridStyle] == [GridStyle.none] 生效
double childAspectRatio = 1,
/// 子元素在主轴上的长度。[mainAxisExtent] 优先 [childAspectRatio]
/// [gridStyle] == [GridStyle.none] 生效
double? mainAxisExtent,
/// 占位
Widget placeholder = const PlaceholderChild(),
this.header,
this.footer,
}) : sliver = [
SliverListGrid.count(
semanticIndexCallback: semanticIndexCallback,
placeholder: placeholder,
mainAxisExtent: mainAxisExtent,
maxCrossAxisExtent: maxCrossAxisExtent,
childAspectRatio: childAspectRatio,
crossAxisCount: crossAxisCount,
mainAxisSpacing: mainAxisSpacing,
crossAxisSpacing: crossAxisSpacing,
addSemanticIndexes: addSemanticIndexes,
addRepaintBoundaries: addRepaintBoundaries,
addAutomaticKeepALives: addAutomaticKeepALives,
itemExtent: itemExtent,
prototypeItem: prototypeItem,
gridStyle: gridStyle,
children: children)
];