columns static method

Implementation

static List<PlexDataGridColumn<List<PlexDataTableValueCell>>> columns(
  List<PlexDataTableHeaderCell> headers, {
  WidthMode? tableWidthMode,
}) {
  return <PlexDataGridColumn<List<PlexDataTableValueCell>>>[
    for (int i = 0; i < headers.length; i++)
      PlexDataGridColumn<List<PlexDataTableValueCell>>(
        id: headers[i].columnName,
        title: headers[i].columnName,
        numeric: headers[i].isNumber,
        sortable: headers[i].showOrderByControl,
        searchable: headers[i].showFilterControl,
        filterable: headers[i].showFilterControl,
        groupable: true,
        sizeMode: _columnSizeMode(
          headers[i],
          tableWidthMode: tableWidthMode,
          isLast: i == headers.length - 1,
        ),
        value: (List<PlexDataTableValueCell> row) =>
            valueFor(row, headers[i].columnName),
        cell: (BuildContext context, List<PlexDataTableValueCell> row) {
          return _buildCell(row, headers[i].columnName);
        },
      ),
  ];
}