SliverListGrid class

Inheritance
Available extensions

Constructors

SliverListGrid.builder({Key? key, required IndexedWidgetBuilder? itemBuilder, IndexedWidgetBuilder? separatorBuilder, int? itemCount, GridStyle gridStyle = GridStyle.none, int crossAxisCount = 1, double? maxCrossAxisExtent, double mainAxisSpacing = 0, double crossAxisSpacing = 0, double childAspectRatio = 1, double? mainAxisExtent, ChildIndexGetter? findChildIndexCallback, SemanticIndexCallback semanticIndexCallback = kDefaultSemanticIndexCallback, double? itemExtent, Widget? prototypeItem, bool addAutomaticKeepALives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, Widget placeholder = const PlaceholderChild()})
const
SliverListGrid.count({Key? key, required List<Widget>? children, GridStyle gridStyle = GridStyle.none, int crossAxisCount = 1, double? maxCrossAxisExtent, double mainAxisSpacing = 0, double crossAxisSpacing = 0, double childAspectRatio = 1, double? mainAxisExtent, SemanticIndexCallback semanticIndexCallback = kDefaultSemanticIndexCallback, double? itemExtent, Widget? prototypeItem, bool addAutomaticKeepALives = true, bool addRepaintBoundaries = true, bool addSemanticIndexes = true, Widget placeholder = const PlaceholderChild()})
const

Properties

addAutomaticKeepALives bool
final
addRepaintBoundaries bool
final
addSemanticIndexes bool
final
childAspectRatio double
子元素在横轴长度和主轴长度的比例 gridStyle == GridStyle.none 生效
final
children List<Widget>?
少量子组件可使用 children
final
crossAxisCount int
横轴子元素的数量 自适应最大像素 use SliverGridDelegateWithFixedCrossAxisCount or SliverSimpleGridDelegateWithFixedCrossAxisCount
final
crossAxisSpacing double
横轴方向子元素的间距
final
findChildIndexCallback ChildIndexGetter?
final
gridStyle GridStyle
final
hashCode int
The hash code for this object.
no setterinherited
itemBuilder IndexedWidgetBuilder?
大量子组件
final
itemCount int?
final
itemExtent double?
use SliverFixedExtentListitemExtent 优先 prototypeItem
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisExtent double?
子元素在主轴上的长度。mainAxisExtent 优先 childAspectRatio gridStyle == GridStyle.none 生效
final
mainAxisSpacing double
主轴方向子元素的间距
final
maxCrossAxisExtent double?
横轴元素最大像素 自适应列数 use SliverGridDelegateWithMaxCrossAxisExtent or SliverSimpleGridDelegateWithMaxCrossAxisExtent
final
placeholder Widget
itemCount==0 || children.isisEmpty 时 占位
final
prototypeItem Widget?
use SliverPrototypeExtentListitemExtent 优先 prototypeItem
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticIndexCallback SemanticIndexCallback
final
separatorBuilder IndexedWidgetBuilder?
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited