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,
}) {
  final theme = CLTheme.of(this);
  return TableColumn<T>(
    id: id,
    title: Text(title),
    cellBuilder: (item) => Row(
      mainAxisSize: MainAxisSize.min,
      children: actions
          .map((a) => CLIconButton(
                onTap: () => a.onPressed(item),
                iconData: a.icon,
                backgroundColor: Colors.transparent,
                iconColor: theme.secondaryText,
                iconSize: theme.iconSizeCompact,
                tooltip: a.tooltip,
              ))
          .toList(),
    ),
    sizeFactor: sizeFactor,
  );
}