ComboBoxColumn class
A combo box — a free-text field with an attached suggestions dropdown. The user may type any value OR pick one of options.
When fetchOptions is supplied, the cell editor uses a hybrid source: it shows the local options instantly and, when the query has no (or too few) local matches, loads more from fetchOptions (a remote/db search). Use remoteThreshold to tune when the network is consulted (default: only when nothing matches locally) and remoteMinChars to require a few characters first.
- Inheritance
-
- Object
- EditableColumn
- ComboBoxColumn
Constructors
-
ComboBoxColumn({required String key, required String label, List<
String> options = const [], Future<List< fetchOptions(String query)?, int remoteThreshold = 1, int remoteMinChars = 1, double width = 180, CellAlign? align, bool mono = false, bool required = false, String? validate(String value)?, EditableCellValidator? cellValidator, EditableCellBuilder? cellBuilder})String> > -
const
Properties
- align → CellAlign
-
Content alignment (number columns default to CellAlign.end).
finalinherited
- blankValue → String
-
The blank value a new row should hold for this column (first option for
a select, empty otherwise).
no setterinherited
- cellBuilder → EditableCellBuilder?
-
Optional custom renderer for the cell's read-only content. When set, the
default text is replaced by whatever this returns (a chip, badge, bar…).
Editing still uses the standard editor / select menu.
finalinherited
- cellValidator → EditableCellValidator?
-
Row-aware validator — like validate but also receives the whole row,
so it can flag a cell based on its siblings (e.g. "end ≥ start", or
"total must equal qty × price"). Runs after validate.
finalinherited
- editableInline → bool
-
Whether the cell opens the standard inline text editor (text / number /
date / time / combo). Picker-only kinds (select, color) and the
non-editable kinds (readonly, computed) return false.
no setterinherited
-
fetchOptions
→ Future<
List< Function(String query)?String> > -
Optional async loader. Receives the current query, returns matching values.
Triggers the hybrid (local-first, load-more) behaviour when set.
final
- format → String Function(String raw)?
-
Optional custom formatter applied on commit (overrides the built-in
number grouping). Receives the raw typed string, returns the stored one.
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- includeInTotal → bool
-
Include this (numeric) column in the totals footer sum.
finalinherited
- isAsync → bool
-
Whether this combo loads extra options asynchronously.
no setter
- isReadOnly → bool
-
Whether the cell can never be edited (readonly / computed).
no setterinherited
- key → String
-
Stable key into each EditableRow.
finalinherited
- label → String
-
Header label.
finalinherited
- mono → bool
-
Render the cell value in the monospace family (codes, amounts).
finalinherited
-
options
→ List<
String> -
Choices for EditableColumnType.select.
finalinherited
- remoteMinChars → int
-
Require at least this many typed characters before hitting fetchOptions.
final
- remoteThreshold → int
-
Consult fetchOptions only when local matches are fewer than this.
final
- required → bool
-
Required — empty cells flag red and feed the validation badge.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → EditableColumnType
-
Editing / rendering behaviour.
finalinherited
- validate → String? Function(String value)?
-
Optional validator — return an error message, or null when valid. Runs
in addition to required. Value-only; for cross-column rules use
cellValidator.
finalinherited
- width → double
-
Fixed pixel width of the column.
finalinherited
Methods
-
displayValue(
EditableRow row) → String -
The string this column shows for
row. Stored value for most kinds;ComputedColumnoverrides this to derive it from the whole row.inherited -
errorFor(
String value, [EditableRow? row]) → String? -
Validation error for
valueunder this column, or null when valid. Passrowto also run the row-aware cellValidator.inherited -
normalize(
String raw) → String -
Normalises a freshly-typed value on commit. Base honours an explicit
format callback, else groups numbers; subclasses override to clamp /
reformat dates, times, numerics.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited