TableView class

Material-style widget that displays its content in a both vertically and horizontally scrollable table with fixed-width freezable columns.

This widget will try to expand to the highest constraints given, unless shrinkWrapVertical is used. Make sure to either put it inside a box with a finite size or to set shrinkWrapVertical to true to let this widget calculate its height (width is still required to be finite).

Inheritance
Implementers

Constructors

TableView.builder({Key? key, TableViewStyle? style, TableViewController? controller, required List<TableColumn> columns, TextDirection? textDirection, double? minScrollableWidth, double? minScrollableWidthRatio, TableRowReorder? rowReorder, bool addAutomaticKeepAlives = false, required int rowCount, required double? rowHeight, ItemExtentBuilder? rowHeightBuilder, Widget? rowPrototype, required TableRowBuilder rowBuilder, TablePlaceholderBuilder placeholderBuilder = _defaultPlaceholderBuilder, TablePlaceholderRowBuilder? placeholderRowBuilder, TablePlaceholderShade? placeholderShade, TableBodyContainerBuilder bodyContainerBuilder = _defaultBodyContainerBuilder, TableHeaderBuilder? headerBuilder, double? headerHeight, TableFooterBuilder? footerBuilder, double? footerHeight, ScrollPhysics? physics, ScrollPhysics? physicsHorizontal, bool shrinkWrapVertical = false, bool shrinkWrapHorizontal = false})
const

Properties

addAutomaticKeepAlives bool
Whether to wrap each row in an AutomaticKeepAlive.
final
bodyContainerBuilder → TableBodyContainerBuilder
A function that will be called on-demand enabling wrapping vertically scrollable table body section that contains all visible rows including placeholders.
final
columns List<TableColumn>
List of column descriptions to display in a table.
final
controller TableViewController?
Controller for the state of a table.
final
footerBuilder TableFooterBuilder?
A function that will be called on-demand for each cell in a footer in order to build a widget for that section of a footer.
final
footerHeight double
Height of a footer. If null, rowHeight will be used instead. If footerBuilder is specified and rowHeight is null, footerHeight becomes required.
final
hashCode int
The hash code for this object.
no setterinherited
headerBuilder TableHeaderBuilder?
A function that will be called on-demand for each cell in a header in order to build a widget for that section of a header.
final
headerHeight double
Height of a header. If null, rowHeight will be used instead.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
minScrollableWidth double?
Minimum scrollable width that may not be taken up by frozen columns. If a resulting scrollable width is less than this property, columns will be unfrozen according to freeze priority until scrollable width is greater than or equal to this property.
final
minScrollableWidthRatio double?
Minimum scrollable width ratio in relation to the width of a table. Used to calculate minScrollableWidth depending on an overall table width if that property is null.
final
physics ScrollPhysics?
How the vertical scroll view should respond to user input.
final
physicsHorizontal ScrollPhysics?
How the horizontal scroll view should respond to user input.
final
placeholderBuilder TablePlaceholderBuilder
A function that will be called on-demand for building the placeholder row widget. As oppose to placeholderRowBuilder, it never gets called more than once per build cycle as the same widget is reused for every placeholder row built.
final
placeholderRowBuilder TablePlaceholderRowBuilder?
A function that will be called on-demand for building a placeholder row widget. As oppose to placeholderBuilder, this function gets called to build every placeholder row individually. Consider using placeholderBuilder when all placeholder rows are the same as each other.
final
placeholderShade TablePlaceholderShade?
A callback that allows application of a shader to the placeholder rows.
final
rowBuilder TableRowBuilder
A function that will be called on-demand for each row displayed in order to build a widget of a row of the table.
final
rowCount int
Count of rows displayed in a table.
final
rowHeight double?
Height of each row displayed in a table.
final
rowHeightBuilder ItemExtentBuilder?
When this function is set and the rowHeight is set to null, this function will be used to determine the height of each row, which will improve performance.
final
rowPrototype Widget?
When this property is set, the rowHeight is set to null and the rowHeightBuilder is set to null this widget will be used to determine the height of each row of the table, which will improve the performance.
final
rowReorder TableRowReorder?
When a non-null value is specified, SliverReorderableList instantiated using properties from this object will be used by the table. This enables row reordering using the same way as one would working with ReorderableListView. This also means that each row widget built by a rowBuilder is required to have a unique key.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shrinkWrapHorizontal bool
Whether the width of the TableView in should be determined by the contents being viewed.
final
shrinkWrapVertical bool
Whether the height of the TableView in should be determined by the contents being viewed.
final
style TableViewStyle?
Display style of the table.
final
textDirection TextDirection?
Text direction of the table. Determines horizontal scroll axis and column layout direction as well.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<TableView>
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, int wrapWidth = 65}) 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