checkBox static method

Widget checkBox({
  1. bool isChecked = false,
  2. required dynamic onChanged(
    1. bool?
    ),
  3. Color borderColor = Colors.white,
  4. double borderWidth = 1.5,
  5. Color? activeColor = Colors.blue,
  6. Color? checkColor = Colors.white,
  7. double borderRadius = 4,
  8. double? scale,
})

Returns a styled checkbox widget.

Use this in dropdown lists for multi-selection UI.

Implementation

static Widget checkBox({
  bool isChecked = false,
  required Function(bool?) onChanged,
  Color borderColor = Colors.white,
  double borderWidth = 1.5,
  Color? activeColor = Colors.blue,
  Color? checkColor = Colors.white,
  double borderRadius = 4,
  double? scale,
}) {
  return Transform.scale(
    scale: scale,
    child: Checkbox(
      value: isChecked,
      onChanged: onChanged,
      activeColor: activeColor,
      checkColor: checkColor,
      side: BorderSide(color: borderColor, width: borderWidth),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(borderRadius),
      ),
      materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
      visualDensity: VisualDensity.compact,
    ),
  );
}