Skip to content
Get started
Menu
Get started

Data table

PaymentDataTable displays host records with typed cells, selection, row actions and paging. Select-all covers the current page. On narrow screens and at large text, columns become labeled rows.

With local paging or no pagination, the table filters through a host predicate and sorts copies of the rows. With offset or cursor paging, it displays rows as supplied and calls the host when sorting or paging changes.

Batch actions sit beside the selection count when they fit; otherwise they move below it without wrapping their labels. Column reorder and resize are unsupported. Leave their deprecated flags set to false.

Settlement records with labelled row values, selection and table actions. Part 1 of 3.Continued: Settlement records with labelled row values, selection and table actions. Part 2 of 3.Continued: Settlement records with labelled row values, selection and table actions. Part 3 of 3.Settlement records with labelled row values, selection and table actions. Part 1 of 3.Continued: Settlement records with labelled row values, selection and table actions. Part 2 of 3.Continued: Settlement records with labelled row values, selection and table actions. Part 3 of 3.
Data table Shown in 3 images, top to bottom; each repeats the last few lines of the one before.
Settlement records with labelled row values, selection and table actions at 200 percent text. Part 1 of 5.Continued: Settlement records with labelled row values, selection and table actions at 200 percent text. Part 2 of 5.Continued: Settlement records with labelled row values, selection and table actions at 200 percent text. Part 3 of 5.Continued: Settlement records with labelled row values, selection and table actions at 200 percent text. Part 4 of 5.Continued: Settlement records with labelled row values, selection and table actions at 200 percent text. Part 5 of 5.
200% text Shown in 5 images, top to bottom; each repeats the last few lines of the one before.
example/lib/screens/gallery_content.dart
PaymentDataTable<int>(
columns: columns,
rows: const [],
rowKey: (r) => '$r',
pending: true,
);
Settlement table with search, selection, pagination, loading rows and an empty state; later examples extend beyond the 1200 dp crop cap, in English on Android tablet. Part 1 of 2.Continued: Settlement table with search, selection, pagination, loading rows and an empty state; later examples extend beyond the 1200 dp crop cap, in English on Android tablet. Part 2 of 2.
Wide (tablet) Shown in 2 images, top to bottom; each repeats the last few lines of the one before.

Variants: text, link, date, id, status, currency cells; local, offset, cursor pages.

Choose local paging for records already held by the app. With offset or cursor paging, supply the current page and handle page and sort callbacks in the host.

Situation Variant / composition Payment example
Settlement selection and sort local pages Use offset/cursor callbacks for host pages; never reorder those rows locally.

Use Table for static fees.

Choose paging by who holds the rows:

Who holds the rows Paging
The host supplied the complete list Local paging
The host fetches one page at a time, with a numeric page position Offset callbacks
The host fetches one page at a time, without a numeric position Cursor callbacks

The host supplies loading, error and empty state, selected row IDs and paging data. For server paging, keep sorting and filtering on the server as well.

Do: Use offset/cursor callbacks for host pages; never reorder those rows locally.

Don’t: Enable deprecated column reorder or resize flags.

Use short column labels and explicit status words. Keep currency visible and references distinguishable from amounts.

Narrow rows retain column context in semantics. Select-all names its page scope, and sorting announces the column and direction.

On phones, select-all has a visible label. The sort trigger names its column and direction; Default order restores host order.

Example statement screen with synthetic dataExample statement screen with synthetic data
Example: statement

PaymentDataTable

class PaymentDataTable extends StatefulWidget · lib/src/content/data_table.dart

Responsive host data with page-scoped selection and local sort/filter.

ParameterTypeDefaultDescription
columns:requiredList<PaymentDataColumn<T>>—Column definitions in initial reading order.
rows:requiredList<T>—Host data; a complete local set or one host-controlled page.
rowKey:requiredString Function(T row)—Returns a stable unique selection key for a row.
pagination:PaymentPagination?const PaymentPagination.local(pageSize: 25)Page strategy; null displays all supplied rows.
onRowPressed:void Function(T row)?—Optional host action when a data row is pressed.
rowActions:List<PaymentRowActionEntry<T>>const <Never>[]Per-row actions and named groups.
selection:Set<String>?—Host-controlled selected row keys; null hides selection.
onSelectionChanged:ValueChanged<Set<String>>?—Reports the complete new selection to the host.
batchActions:List<PaymentButton>const []Host actions displayed while rows are selected.
pending:boolfalseReplaces data with a static table skeleton.
emptyMessage:PaymentEmptyMessage?—Host explanation and optional next action for an empty table.
errorText:String?—Host load error shown with danger tone.
onRetry:VoidCallback?—Host retry action.
initialSort:PaymentDataSort?—Initial sort state for this table instance.
onSortChanged:ValueChanged<PaymentDataSort?>?—Reports sort intent, including null for host order.
filter:bool Function(T row, String query)?—Host predicate, permitted only for local data.
filterQuery:String?—Query passed to the host predicate.
enableColumnReorder:boolfalseNot supported (D28); must remain false.
enableColumnResize:boolfalseNot supported (D28); must remain false.
onColumnOrderChanged:ValueChanged<List<String>>?—Not supported (D28); configure columns through the host.
caption:String?—Spoken description of the data set.

PaymentDataColumn

class PaymentDataColumn · lib/src/content/data_table.dart

One host-owned data column.

ParameterTypeDefaultDescription
key:requiredString—Stable column identifier.
label:requiredString—Visible and spoken label.
value:requiredObject? Function(T row)—Extracts a display value from a host row.
cell:PaymentCellTypePaymentCellType.textPresentation for the extracted value.
statusMap:Map<String, StatusTone>?—Maps status text to semantic tones.
onPressed:void Function(T row)?—Host action for this row.
hideHeaderLabel:boolfalseHides the visual heading while retaining its spoken label.
pinned:boolfalseKeeps this column fixed during horizontal scrolling.
sortable:boolfalseEnables the ascending, descending, host-order cycle.
compare:int Function(T a, T b)?—Optional comparison of host rows for local sorting.

PaymentCellType

enum PaymentCellType · lib/src/content/data_table.dart

Supported host value presentations.

ValueDescription
textText value.
linkLink value.
dateDate value.
idId value.
statusStatus value.
currencyCurrency value.

PaymentRowActionEntry

abstract class PaymentRowActionEntry · lib/src/content/data_table.dart

Closed family of row actions.

PaymentRowAction

class PaymentRowAction extends PaymentRowActionEntry<T> · lib/src/content/data_table.dart

An action on a host row.

ParameterTypeDefaultDescription
id:requiredString—Stable host action identifier.
label:requiredString—Visible and spoken label.
onPressed:requiredvoid Function(T row)—Host action for this row.
destructive:boolfalsePlaces this action in the separate destructive menu group.

PaymentRowActionGroup

class PaymentRowActionGroup extends PaymentRowActionEntry<T> · lib/src/content/data_table.dart

A named action group.

ParameterTypeDefaultDescription
id:requiredString—Stable host action identifier.
label:requiredString—Visible and spoken label.
actions:requiredList<PaymentRowAction<T>>—Actions in this named group.

PaymentPagination

class PaymentPagination · lib/src/content/data_table.dart

Page delivery strategy. Pages start at one.

PaymentPagination.local(…)

ParameterTypeDefaultDescription
pageSize:requiredint—Maximum rows per local page.
onPageChanged:ValueChanged<int>?—Reports the requested page to the host.

PaymentPagination.offset(…)

ParameterTypeDefaultDescription
page:requiredint?—Host-controlled page number, starting at one.
pageSize:requiredint—Maximum rows per local page.
totalItems:requiredint?—Total host row count for offset paging.
onPageChanged:requiredValueChanged<int>?—Reports the requested page to the host.

PaymentPagination.cursor(…)

ParameterTypeDefaultDescription
page:requiredint?—Host-controlled page number, starting at one.
pageSize:requiredint—Maximum rows per local page.
hasMore:requiredbool?—Whether cursor paging can request a next page.
onPageChanged:requiredValueChanged<int>?—Reports the requested page to the host.

PaymentDataSort

class PaymentDataSort · lib/src/content/data_table.dart

Current column sort; null restores host order.

ParameterTypeDefaultDescription
columnKeyrequiredpositionalString—Identifier of the sorted column.
ascending:booltrueWhether values sort in ascending order.

PaymentEmptyMessage

class PaymentEmptyMessage · lib/src/content/empty_message.dart

Empty-state explanation and an optional next action.

ParameterTypeDefaultDescription
titlerequiredpositionalString—What is empty.
message:String?—Why it is empty.
actionLabel:String?—Next action label.
onAction:VoidCallback?—Host action, supplied together with its label.
icon:IconDataIcons.inbox_outlinedSupporting visual cue.