Skip to main content

Examples

  • States
  • With Labels
Checkbox states example

Different checkbox states.

NeoCheckbox(
  isChecked: false,
  onChanged: (value) {
    // Handle state change
  },
),

Properties

Required

isChecked
bool
required
The current checked state of the checkbox. true represents checked, false represents unchecked.
onChanged
ValueChanged<bool>
required
Callback function called when the checkbox state changes. Receives the new boolean value.

Content

label
String
The text label displayed next to the checkbox.
description
String
Additional descriptive text displayed below the label. Useful for providing context or additional information about the option.

State

isIndeterminate
bool
default:"false"
Whether the checkbox is in an indeterminate state. When true, displays a minus icon regardless of the isChecked value. Commonly used for “select all” checkboxes when only some items are selected.
enabled
bool
default:"true"
Whether the checkbox is interactive. When false, the checkbox appears with reduced opacity and doesn’t respond to user interactions.

Best Practices

  • Combine with NeoHaptics in the onChanged callback for enhanced user experience on supported devices.

Integration Notes

  • When a label and/or description is provided, the entire area is clickable, not just the checkbox itself.
I