Skip to content
On this page

Checkbox

A checked or unchecked control with configurable size and colors.

Checkbox in FluttyUICheckbox in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

Usage

Use this expression inside a stateful widget. Keep the current value in your widget state and update it in the callback.

ui.Checkbox(
  value: accepted,
  onChanged: (value) => setState(() => accepted = value),
)

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Checkbox

const Checkbox({
  super.key,
  this.motion,
  required this.value,
  required this.onChanged,
  this.activeColor,
  this.checkColor,
  this.borderColor,
  this.borderRadius,
  this.size,
  this.dimension,
  this.iconSize,
  this.strokeWidth = 2.5,
  this.isDisabled = false,
});
ParameterTypeRequiredDefault
keyKey?Nonull
motionComponentMotion?Nonull
valueboolYes—
onChangedValueChanged<bool>?Yes—
activeColorColor?Nonull
checkColorColor?Nonull
borderColorColor?Nonull
borderRadiusdouble?Nonull
sizeComponentSize?Nonull
dimensiondouble?Nonull
iconSizedouble?Nonull
strokeWidthdoubleNo2.5
isDisabledboolNofalse

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/forms/checkbox/checkbox.dart

This reference is generated from the Checkbox declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI