DataTable<T> class

A data table component for displaying tabular data.

Inheritance

Constructors

DataTable({required List<T> items, required List<DataColumn<T>> columns, void onRowTap(T item)?, bool selectable = false, Set<T>? selectedItems, void onSelectionChanged(Set<T> selected)?, bool showDividers = true, bool showHeader = true, bool stickyHeader = false, String emptyMessage = 'No data available', Key? key})
const

Properties

columns List<DataColumn<T>>
Column definitions
final
emptyMessage String
Empty state message
final
hashCode int
The hash code for this object.
no setterinherited
items List<T>
The data items to display
final
key Key?
Controls how one component replaces another component in the tree.
finalinherited
onRowTap → void Function(T item)?
Callback when a row is clicked
final
onSelectionChanged → void Function(Set<T> selected)?
Callback when selection changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectable bool
Whether rows are selectable
final
selectedItems Set<T>?
Currently selected items
final
showDividers bool
Whether to show row dividers
final
showHeader bool
Whether to show the header
final
Fixed header
final

Methods

createElement() Element
Creates a StatefulElement to manage this component's location in the tree.
inherited
createState() State<DataTable<T>>
Creates the mutable state for this component at a given location in the tree.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

styles List<StyleRule>
final