Search code examples
flutterpaginateddatatable

Flutter PaginatedDataTable: how to show checkbox column?


How to show the checkbox column?

 PaginatedDataTable(
    showCheckboxColumn: true,
    columns: _columns,
    source: _dataTableSource,
  ),

There is no checkbox column.


Solution

  • According to the document

    showCheckboxColumn → bool Whether the widget should display checkboxes for selectable rows.

    so your DataRow must be selectable if you want to show the checkbox column, add onSelectChanged to the DataRow

         DataRow(
           cells: <DataCell>[ ],
           onSelectChanged: (selected) {}
          );