Error Indicators
FdcGrid(
dataSet: customers,
cellIndicator: const FdcGridCellIndicator(
errorIndicator: FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.marker,
markerStyle: FdcErrorIndicatorMarkerStyle(
color: Colors.red,
size: 11,
),
),
),
columns: const [
FdcTextColumn(fieldName: 'company'),
FdcTextColumn(fieldName: 'contact'),
FdcIntegerColumn(fieldName: 'priority'),
FdcDecimalColumn(fieldName: 'credit_limit'),
],
);
Grid error indicators expose field-level dataset validation directly on the affected cells. They do not define validation rules and do not replace the dataset error model; they only control how existing errors are presented.
The sample intentionally submits an invalid record. Hover a red corner marker to read the validation message, then correct the value and post the record again.
Configure grid markers
Error presentation is configured through FdcGridCellIndicator.errorIndicator:
FdcGrid(
dataSet: customers,
cellIndicator: const FdcGridCellIndicator(
errorIndicator: FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.marker,
markerStyle: FdcErrorIndicatorMarkerStyle(
color: Colors.red,
size: 11,
),
),
),
)
The marker is drawn in the top-left corner of a cell with a field-specific validation error. Its tooltip contains the dataset error message.
Supported modes
Grid cells support two modes:
| Mode | Behavior |
|---|---|
FdcErrorIndicatorMode.marker | Shows a compact corner marker and validation tooltip. This is the default. |
FdcErrorIndicatorMode.none | Keeps the dataset error but suppresses its cell marker. |
FdcErrorIndicatorMode.inline is intentionally not supported by grid cells because an inline message would change row geometry. Use inline presentation with standalone editors instead.
Disable grid markers
const FdcGridCellIndicator(
errorIndicator: FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.none,
),
)
This affects presentation only. Posting still fails while dataset validation errors remain unresolved.
Column-level suppression
A column with showIndicator: false suppresses the cell indicator surface for that column, including validation markers:
const FdcTextColumn<dynamic>(
fieldName: 'thumbnail_caption',
showIndicator: false,
)
Use this only when the cell has another clear error-feedback mechanism. Otherwise users may have no visible field-level indication of why posting failed.
Where errors come from
Markers can present errors produced by:
- required-field validation;
- field constraints such as minimum and maximum values;
- custom field validators;
- record validators that target a
fieldName; - parsing and data-entry failures captured by the bound editing lifecycle.
Record-level errors without a target field cannot be attached to a specific cell. Present those through an application message, dialog, or dataset-level error summary.