A material design data table.

Displaying data in a table is expensive, because to lay out the table all the data must be measured twice, once to negotiate the dimensions to use for each column, and once to actually lay out the table given the results of the negotiation.

For this reason, if you have a lot of data (say, more than a dozen rows with a dozen columns, though the precise limits depend on the target device), it is suggested that you use a PaginatedDataTable which automatically splits the data into multiple pages.

See also:



DataTable({Key key, List<DataColumn> columns, int sortColumnIndex, bool sortAscending: true, ValueSetter<bool> onSelectAll, List<DataRow> rows })

Creates a widget describing a data table.


columns List<DataColumn>

The configuration and labels for the columns in the table.

onSelectAll ValueSetter<bool>

Invoked when the user selects or unselects every row, using the checkbox in the heading row.

rows List<DataRow>

The data to show in each row (excluding the row that contains the column headings). Must be non-null, but may be empty.

sortAscending bool

Whether the column mentioned in sortColumnIndex, if any, is sorted in ascending order.

sortColumnIndex int

The current primary sort key's column.

hashCode int

The hash code for this object.

read-only, inherited
key Key

Controls how one widget replaces another widget in the tree.

final, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited


build(BuildContext context) Widget

Describes the part of the user interface represented by this widget.

createElement() StatelessElement

Creates a StatelessElement to manage this widget's location in the tree.

debugFillDescription(List<String> description) → void

Add additional information to the given description for use by toString.

@mustCallSuper, @protected, inherited
noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

toString() String

Returns a string representation of this object.

toStringShort() String

A short, textual description of this widget.



operator ==(other) bool

The equality operator.