Carbon Flutter
  • Overview ⚡️
  • Installation ⚙️
  • Widgets 🧩
    • Breadcrumb
    • Button
    • Checkbox
    • Form
    • Icons
    • Link
    • Notification
    • OverflowMenu
    • Text
    • TextField
    • Toggle
Powered by GitBook
On this page
  • Overview
  • Widget API
  • Example

Was this helpful?

  1. Widgets 🧩

Checkbox

PreviousButtonNextForm

Last updated 2 years ago

Was this helpful?

Overview

Checkboxes are used for multiple choices, not for mutually exclusive choices. Each checkbox works independently from other checkboxes in the list, therefore checking an additional box does not affect any other selections.

Widget API

Property
Description

onChange

Called when the value of the checkbox change. This callback passes a new value, but doesn't update its state internally.

  • Type: Function(bool value)

  • Default: required

enable

Whether the checkbox is enabled or not.

  • Type: bool

  • Default: true

value

Whether the checkbox is checked or not.

  • Type: bool

  • Default: false

label

A text to display besides the checkbox.

  • Type: String?

  • Default: optional

Example

CCheckbox(
  enable: false,
  value: value,
  onChange: (value) {
    setState(() => value = !value);
  },
),