Skip to content

Checkbox ​

A single-style checkbox with a label and built-in error state, wrapping Flutter's own Checkbox styling knobs (focus color, overlay color, splash radius) directly as parameters.

View source on GitHub ↗

CLI ​

Install this component into your project:

checkbox
$flutter_beautify add checkbox

Variants ​

One constructor, FBCheckbox(...) — no named styles, everything is a parameter (including isError for a validation state).

Key parameters ​

ParameterTypeDefault
valueboolrequired
onChangedValueChanged<bool?>required
labelString?—
boxColor / checkColorColor?—
isErrorbool?— swaps in errorBoxColor/errorCheckColor
disablebool?—

Usage ​

dart
import 'package:your_app/widgets/checkbox.dart';

FBCheckbox(
  value: agreed,
  onChanged: (v) => setState(() => agreed = v ?? false),
  label: 'I agree to the terms',
);

Released under the MIT License.