Checkbox

The Checkbox widget is a visual control that allows a user to select or deselect a single option. It implements the Material Design specification for a checkbox, representing a binary choice that is typically independent of other choices (e.g., selecting multiple items in a list or toggling a setting on/off).

Properties

These properties define the widget's interaction, background, and overall dimensions.

Property

Type

Description

value

bool

The current state of the toggle (true/false).

size

double

The overall dimension (width/height) of the background container.

activeBackground

Color

Background color when active (value: true).

inactiveBackground

Color

Background color when inactive (value: false).

borderWidth

double

The thickness of the border when inactive.

shape

BoxShape

The container's shape (BoxShape.rectangle or BoxShape.circle).

borderRadius

double

The corner radius of the container.

Active Icon Properties

These properties define the appearance of the icon when the value is true (checked).

Property

Type

Description

activeIcon

IconData

The specific icon displayed (e.g., Icons.visibility).

activeIconSize

double

The size of the icon displayed.

activeIconColor

Color

The color of the icon displayed.

Inactive Icon Properties

These properties define the appearance of the icon when the value is false (unchecked).

Property

Type

Description

inactiveIcon

IconData

The specific icon displayed (e.g., Icons.visibility_off).

inactiveIconSize

double

The size of the icon displayed.

inactiveIconColor

Color

The color of the icon displayed.

Default Properties

The Checkbox widget supports all Default Properties.

Last updated