textColumn<T extends Object> method

TableColumn<T> textColumn<T extends Object>({
  1. required String title,
  2. required String value(
    1. T
    ),
  3. double sizeFactor = .1,
  4. bool sortable = false,
  5. String? id,
  6. bool isMain = false,
})

Build a simple text column.

title is the header label, value extracts the string to render from the row item. sizeFactor follows the same semantics as the underlying TableColumn.sizeFactor (fraction of the available width).

Implementation

TableColumn<T> textColumn<T extends Object>({
  required String title,
  required String Function(T) value,
  double sizeFactor = .1,
  bool sortable = false,
  String? id,
  bool isMain = false,
}) {
  return TableColumn<T>(
    id: id,
    title: Text(title),
    cellBuilder: (item) => Text(value(item)),
    sizeFactor: sizeFactor,
    sortable: sortable,
    isMain: isMain,
  );
}