Skip to main content

Boolean editor

FdcBooleanEdit binds a boolean field to either a checkbox or a switch.

Checkbox

FdcBooleanEdit(
dataSet: customers,
fieldName: 'active',
label: 'Active',
)

Switch

FdcBooleanEdit(
dataSet: settings,
fieldName: 'email_notifications',
label: 'Email notifications',
control: FdcBooleanControl.switchControl,
)

Both control styles write through the normal dataset edit lifecycle.

Required boolean fields

When a boolean field is required, the editor participates in Flutter Form.validate() behavior. Use this when true is the only acceptable completed state, such as explicit confirmation or acceptance workflows.

Read-only state

FdcBooleanEdit(
dataSet: orders,
fieldName: 'invoiced',
readOnly: true,
)

Use a read-only editor when the value should remain visible in the form but is controlled by application logic.