Skip to main content
The Stac CheckBox allows you to build a Flutter CheckBox widget using JSON. To know more about the CheckBox widget in Flutter, refer to the official documentation.

Properties

PropertyTypeDescription
idStringThe identifier for the checkbox.
valueboolThe current value of the checkbox.
tristateboolWhether this checkbox is in a tristate mode. Defaults to false.
onChangedStacActionThe callback that is called when the value changes.
mouseCursorStacMouseCursorThe cursor for a mouse pointer when it enters or is hovering over the checkbox.
activeColorStacColorThe color to use when this checkbox is checked.
fillColorStacMaterialColorThe color to use for the fill of the checkbox.
checkColorStacColorThe color to use for the check icon.
focusColorStacColorThe color to use for the checkbox’s focus color.
hoverColorStacColorThe color to use for the checkbox’s hover color.
overlayColorStacMaterialColorThe color to use for the checkbox’s overlay color.
splashRadiusdoubleThe splash radius of the checkbox’s tap target.
materialTapTargetSizeStacMaterialTapTargetSizeConfigures the minimum size of the tap target.
autofocusboolWhether this checkbox should focus itself if nothing else is already focused. Defaults to false.
isErrorboolWhether this checkbox is in an error state. Defaults to false.

Example

StacCheckBox(
  id: 'checkbox_1',
  value: true,
  tristate: false,
  mouseCursor: StacMouseCursor.click,
  activeColor: StacColors.red,
  fillColor: StacMaterialColor(color: StacColors.green),
  checkColor: StacColors.blue,
  focusColor: StacColors.yellow,
  hoverColor: StacColors.pink,
  splashRadius: 20.0,
  materialTapTargetSize: StacMaterialTapTargetSize.padded,
  autofocus: true,
  isError: false,
)