mapColumn function

EditableColumn<EditableRow> mapColumn(
  1. String key,
  2. String label, {
  3. double width = 160,
  4. EditableColumnType type = EditableColumnType.text,
  5. bool readOnly = false,
})

Implementation

EditableColumn<EditableRow> mapColumn(
  String key,
  String label, {
  double width = 160,
  EditableColumnType type = EditableColumnType.text,
  bool readOnly = false,
}) =>
    EditableColumn<EditableRow>(
      label: label,
      width: width,
      type: type,
      value: (r) => r[key] ?? '',
      setValue: readOnly ? null : (r, v) => {...r, key: v},
    );