CustomCheckBoxGroup<T> constructor

CustomCheckBoxGroup<T>({
  1. Key? key,
  2. bool horizontal = false,
  3. required List<T> buttonValuesList,
  4. ButtonTextStyle buttonTextStyle = const ButtonTextStyle(),
  5. double height = 35,
  6. double padding = 3,
  7. double spacing = 0.0,
  8. bool autoWidth = false,
  9. double width = 100,
  10. bool enableShape = false,
  11. double elevation = 0,
  12. double shapeRadius = 50,
  13. double radius = 20,
  14. required List<String> buttonLables,
  15. required void checkBoxButtonValues(
    1. List<T>
    ),
  16. required Color selectedColor,
  17. Color? selectedBorderColor,
  18. WrapAlignment wrapAlignment = WrapAlignment.start,
  19. List<T>? defaultSelected,
  20. required Color unSelectedColor,
  21. Color? unSelectedBorderColor,
  22. ShapeBorder? customShape,
  23. bool absoluteZeroSpacing = false,
  24. ScrollController? scrollController,
  25. EdgeInsetsGeometry? margin,
  26. bool enableButtonWrap = false,
  27. List<T> disabledValues = const [],
  28. Color? disabledColor,
})

spacing Spacing between buttons

Implementation

CustomCheckBoxGroup({
  super.key,
  this.horizontal = false,
  required this.buttonValuesList,
  this.buttonTextStyle = const ButtonTextStyle(),
  this.height = 35,
  double padding = 3,
  double spacing = 0.0,
  this.autoWidth = false,
  this.width = 100,
  this.enableShape = false,
  this.elevation = 0,
  this.shapeRadius = 50,
  this.radius = 20,
  required this.buttonLables,
  required this.checkBoxButtonValues,
  required this.selectedColor,
  this.selectedBorderColor,
  this.wrapAlignment = WrapAlignment.start,
  this.defaultSelected,
  required this.unSelectedColor,
  this.unSelectedBorderColor,
  this.customShape,
  this.absoluteZeroSpacing = false,
  this.scrollController,
  this.margin,
  this.enableButtonWrap = false,
  this.disabledValues = const [],
  this.disabledColor,
})  : assert(buttonLables.length == buttonValuesList.length,
          "Button values list and button lables list should have same number of eliments "),
      assert(buttonValuesList.toSet().length == buttonValuesList.length,
          "Multiple buttons with same value cannot exist") {
  if (absoluteZeroSpacing) {
    this.padding = 0;
    this.spacing = 0;
  } else {
    this.padding = padding;
    this.spacing = spacing;
  }
}