SliverTable class
A sliver that displays a two dimensional scrollable (in both directions) grid of box children. The table consists of a horizontal top header, a vertical left header, and a rowsCount x colsCount grid of cells. The vertical header is pinned at the top edge of the table and displays colsCount cells that are horizontally scrollable. The horizontal header is pinned at the left side of the table and displays rowsCount cells that are vertically scrollable. The grid of cells can scroll both vertically and horizontally under the top and left headers respectively.
The topHeaderBuilder builder callback is used to build the top header's cells, where each cell will be given a height of topHeaderHeight and a width of cellWidth.
To wrap the whole top header in another widget, you can use the topHeaderContainerBuilder callback, which can be used, for example, to add a background color.
The leftHeaderBuilder builder callback is used to build the left header's cells, where each cell will be given a height of cellHeight and a width of leftHeaderCellWidth.
The cellBuilder builder callback is used build the grid's cells, where each cell will be given a height of cellHeight and a width of cellWidth.
The topLeftCorner is used to add any type of widget to the top left corner of the table.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SliverTable
Constructors
- SliverTable({Key? key, required int rowsCount, required int colsCount, required TableCellBuilder cellBuilder, required IndexedWidgetBuilder topHeaderBuilder, required IndexedWidgetBuilder leftHeaderBuilder, Widget? topLeftCorner, IndexedBackgroundBuilder? rowContainerBuilder, WidgetContainerBuilder? topHeaderContainerBuilder, double cellWidth = _kDefaultCellWidth, double cellHeight = _kDefaultCellHeight, double topHeaderHeight = _kDefaultTopHeaderHeight, double leftHeaderCellWidth = _kDefaultLeftHeaderCellWidget})
Properties
- cellBuilder → TableCellBuilder
-
The builder callback used to build each cell in table.
final
- cellHeight → double
-
The height of each cell in the table.
Defaults to 60.0 when no value is set.
final
- cellWidth → double
-
The width of each cell in the table.
Defaults to 60.0 when no value is set.
final
- colsCount → int
-
The number of columns in this SliverTable.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leftHeaderBuilder → IndexedWidgetBuilder
-
The builder callback used to build each cell in the vertical table header.
final
- leftHeaderCellWidth → double
-
The width of each cell in the vertical left-side header.
Defaults to 100.0 when no value is set.
final
- rowContainerBuilder → IndexedBackgroundBuilder?
-
The builder callback used to build the container of each row in the table.
Can be used, for example, to add a background color for each row in the table.
final
- rowsCount → int
-
The number of rows in this SliverTable.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- topHeaderBuilder → IndexedWidgetBuilder
-
The builder callback used to build each cell in the horizontal table header.
final
- topHeaderContainerBuilder → WidgetContainerBuilder?
-
The builder callback used to build the container of the top vertical table header.
Can be used, for example, to add a background color for the top header.
final
- topHeaderHeight → double
-
The height of each cell in the top horizontal table header.
Defaults to 50.0 when no value is set.
final
- topLeftCorner → Widget?
-
The widget shown at the top left corner of the table.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SliverTable> -
Creates the mutable state for this widget at a given location in the tree.
override
-
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