mapHeaders<T, K> static method

List<TKeyValue> mapHeaders<T, K>(
  1. BuildContext ctx,
  2. List<TTableHeader<T, K>> headers,
  3. TListItem<T, K> item,
  4. int index,
)

Maps table headers to key-value items for list view representation.

Implementation

static List<TKeyValue> mapHeaders<T, K>(BuildContext ctx, List<TTableHeader<T, K>> headers, TListItem<T, K> item, int index) {
  return headers
      .map((h) => TKeyValue(
            h.text,
            value: h.getValue(item.data),
            widget: h.builder != null ? h.builder!(ctx, item, index) : null,
            width: h.minWidth,
            minWidth: h.minWidth,
          ))
      .toList();
}