Editors
FDC editors are data-aware Flutter controls. Each editor binds to a dataset and a field name, reads the current record, writes through the dataset edit buffer, and participates in the same validation and change-tracking lifecycle as the data grid.
FdcTextEdit(
dataSet: customers,
fieldName: 'company_name',
label: 'Company name',
)
You do not need to mirror dataset values into separate TextEditingController objects or manually copy form values back into the record.
Available editors
| Editor | Typical field type | Purpose |
|---|---|---|
FdcTextEdit | string, GUID | Single-line text |
FdcMemoEdit | string | Multiline text |
FdcIntegerEdit | integer | Whole-number input |
FdcDecimalEdit | decimal | Exact decimal input |
FdcDateEdit | date | Date input and picker |
FdcTimeEdit | time | Time input and optional picker |
FdcDateTimeEdit | date-time | Combined date and time input |
FdcBooleanEdit | boolean | Checkbox or switch |
FdcComboEdit<T> | supported scalar values | Selection from predefined options |
Dataset lifecycle
A bound editor works with the dataset state rather than owning an independent form model:
- the editor reads the current field value;
- user input moves the dataset into edit mode when needed;
- accepted values are written to the edit buffer;
post()accepts the record edit;applyUpdates()persists pending cached changes when the dataset uses cached updates.
This means a grid and a form can stay synchronized by binding both to the same dataset.
Shared events
Editors can react to focus and value changes:
FdcTextEdit(
dataSet: customers,
fieldName: 'city',
onValueChanged: (event) {
debugPrint('City changed to ${event.value}');
},
)
Use field validation for business rules that belong to the data model. Use editor events for UI behavior and workflow reactions. Configure marker, inline, or hidden validation presentation through FdcErrorIndicatorOptions.
Lightweight import
Applications can use the main package barrel:
import 'package:flutter_data_components/fdc.dart';
Features that only need editor controls can use:
import 'package:flutter_data_components/fdc_edit.dart';