Skip to main content

Error Indicators

Standalone editor error indicators
Loading FDC sample…
FdcTextEdit(
dataSet: customers,
fieldName: 'company_name',
errorIndicator: const FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.marker,
markerStyle: FdcErrorIndicatorMarkerStyle(size: 11),
),
),
FdcTextEdit(
dataSet: customers,
fieldName: 'contact_name',
errorIndicator: const FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.inline,
),
),
FdcIntegerEdit(
dataSet: customers,
fieldName: 'priority',
errorIndicator: const FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.none,
),
);

Standalone editors render validation errors owned by their bound dataset field. The indicator configuration changes presentation only; it does not change validation rules, dataset state, or whether post() succeeds.

The sample shows the same validation model in three presentation modes.

Marker mode

Marker mode is the compact default. It draws a triangular corner marker and exposes the message through a tooltip:

FdcTextEdit(
dataSet: customers,
fieldName: 'company_name',
errorIndicator: const FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.marker,
markerStyle: FdcErrorIndicatorMarkerStyle(
color: Colors.red,
size: 11,
),
),
)

Use marker mode in dense forms where permanently visible error text would consume too much vertical space.

Inline mode

Inline mode renders the validation message with the editor:

FdcTextEdit(
dataSet: customers,
fieldName: 'contact_name',
errorIndicator: const FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.inline,
),
)

Use inline mode when the message should remain immediately visible and the form layout can accommodate additional height. This mode is available to standalone editors, not grid cells.

No visual indicator

FdcIntegerEdit(
dataSet: customers,
fieldName: 'priority',
errorIndicator: const FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.none,
),
)

none hides the local indicator but does not clear the dataset error. Use it when the form already provides a centralized error summary or another accessible validation surface.

Shared configuration

All standard FDC editors expose the same errorIndicator property, including text, memo, integer, decimal, date, time, date-time, boolean, combo, and lookup-capable editors.

const errorPresentation = FdcErrorIndicatorOptions(
mode: FdcErrorIndicatorMode.inline,
);

FdcTextEdit(
dataSet: customers,
fieldName: 'company_name',
errorIndicator: errorPresentation,
)

A shared constant keeps forms visually consistent while still allowing specific controls to override their presentation.

Validation remains dataset-owned

Define required values, bounds, field validators, and record validators in the dataset schema. An editor observes the resulting field error and removes its indicator after the value is corrected and validation succeeds.

For record-level errors, include fieldName in FdcValidationError when the message belongs to one editor. Errors without a field target should be presented in a form-level summary or dialog.

Accessibility guidance

Do not rely on marker color alone. Marker mode provides a tooltip, while inline mode keeps the message visible. When using none, provide an equivalent keyboard-accessible and screen-readable error summary elsewhere in the form.