GridColumn<T> class

Describes one column of a grid.

A column is pure data: it knows how to read a value out of a row, how to show it, how to compare it and whether the user may sort, filter, resize or edit it. It holds no rendering logic, so the same definition can drive the Flutter adapter or any future web adapter.

Constructors

GridColumn({required String field, String? title, ValueGetter<T>? value, ColumnType type = ColumnType.text, double width = 140, double minWidth = 48, double maxWidth = 1200, ColumnAlign? align, ColumnPin pin = ColumnPin.none, bool visible = true, bool sortable = true, bool filterable = true, bool resizable = true, bool groupable = true, ValueFormatter? format, Comparator<Object?>? comparator, ValueSetter<T>? setValue, ValueValidator? validator, String? tooltip, CellRule? rule, Object? sortKey(T row)?})

Properties

align → ColumnAlign?
Content alignment; defaults to ColumnAlign.end for numbers.
final
comparator → Comparator<Object?>?
Overrides the default ordering for this column's values.
final
editable → bool
Whether the user may edit cells in this column.
no setter
effectiveAlign → ColumnAlign
Effective alignment, resolving the type-based default.
no setter
field → String
Stable identifier for the column, unique within a grid.
final
filterable → bool
final
format → ValueFormatter?
Formats the raw value for display. Defaults to Object.toString.
final
groupable → bool
final
hashCode → int
The hash code for this object.
no setterinherited
maxWidth → double
Upper bound honoured by interactive resizing.
final
minWidth → double
Lower bound honoured by interactive resizing.
final
pin → ColumnPin
Edge this column is frozen to.
final
resizable → bool
final
rule → CellRule?
Conditional formatting for this column's cells.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
setValue → ValueSetter<T>?
Writes an edited value back. A column is editable when this is non-null.
final
sortable → bool
final
sortKey → Object? Function(T row)?
Reads the value this column sorts and groups by, when that differs from the value it shows.
final
title → String
Header text.
final
tooltip → String?
Long-form description for a header tooltip.
final
type → ColumnType
Logical value type.
final
validator → ValueValidator?
Rejects invalid edits before they are committed.
final
value → ValueGetter<T>
Reads this column's value out of a row.
final
visible → bool
Whether the column takes part in layout at all.
final
width → double
Preferred width in logical pixels, before resizing or stretching.
final

Methods

clampWidth(double candidate) → double
Clamps candidate into this column's allowed width range.
copyWith({String? field, String? title, ValueGetter<T>? value, ColumnType? type, double? width, double? minWidth, double? maxWidth, ColumnAlign? align, bool clearAlign = false, ColumnPin? pin, bool? visible, bool? sortable, bool? filterable, bool? resizable, bool? groupable, ValueFormatter? format, bool clearFormat = false, Comparator<Object?>? comparator, bool clearComparator = false, ValueSetter<T>? setValue, bool clearSetValue = false, ValueValidator? validator, bool clearValidator = false, String? tooltip, bool clearTooltip = false, CellRule? rule, bool clearRule = false, Object? sortKey(T row)?, bool clearSortKey = false}) → GridColumn<T>
A copy of this column with the given fields replaced.
formattedValue(T row) → String
Display text for row in this column.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
sortValue(T row) → Object?
The value this column orders by: sortKey when one is set, and the displayed value otherwise.
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited