actionColumn<T extends Object> method

TableColumn<T> actionColumn<T extends Object>({
  1. required String title,
  2. required List<TableRowAction<T>> actions,
  3. double sizeFactor = .1,
  4. String? id,
})

Action column rendering a horizontal row of IconButtons.

Use TableRowAction entries to declare icon, tooltip and tap callback per action. Suited for edit/delete/inspect inline operations.

Implementation

TableColumn<T> actionColumn<T extends Object>({
  required String title,
  required List<TableRowAction<T>> actions,
  double sizeFactor = .1,
  String? id,
}) {
  return TableColumn<T>(
    id: id,
    title: Text(title),
    cellBuilder: (item) => Row(
      mainAxisSize: MainAxisSize.min,
      children: actions
          .map((a) => IconButton(
                icon: Icon(a.icon, size: 18),
                tooltip: a.tooltip,
                onPressed: () => a.onPressed(item),
              ))
          .toList(),
    ),
    sizeFactor: sizeFactor,
  );
}