LabeledCheckbox constructor Null safety

const LabeledCheckbox(
  1. {Key? key,
  2. required String label,
  3. required bool? value,
  4. required ValueChanged<bool?>? onChanged,
  5. MainAxisSize mainAxisSize = MainAxisSize.min,
  6. EdgeInsets? padding,
  7. double gap = 0.0,
  8. double? labelFontSize,
  9. FontWeight? labelFontWeight,
  10. Color? labelColor,
  11. Color? labelCheckColor,
  12. TextStyle? labelStyle,
  13. bool? labelSoftWrap,
  14. TextOverflow? labelOverflow,
  15. int? labelMaxLines,
  16. TextWidthBasis? labelTextWidthBasis,
  17. bool tristate = false,
  18. MouseCursor? mouseCursor,
  19. Color? activeColor,
  20. MaterialStateProperty<Color?>? fillColor,
  21. Color? checkColor,
  22. Color? focusColor,
  23. Color? hoverColor,
  24. MaterialStateProperty<Color?>? overlayColor,
  25. double? splashRadius,
  26. MaterialTapTargetSize? materialTapTargetSize,
  27. VisualDensity? visualDensity,
  28. FocusNode? focusNode,
  29. bool autofocus = false,
  30. OutlinedBorder? shape,
  31. BorderSide? side}
)

Implementation

const LabeledCheckbox({
  Key? key,
  required this.label,
  required this.value,
  required this.onChanged,
  this.mainAxisSize = MainAxisSize.min,
  this.padding,
  this.gap = 0.0,

  this.labelFontSize,
  this.labelFontWeight,
  this.labelColor,
  this.labelCheckColor,
  this.labelStyle,
  this.labelSoftWrap,
  this.labelOverflow,
  this.labelMaxLines,
  this.labelTextWidthBasis,

  this.tristate = false,
  this.mouseCursor,
  this.activeColor,
  this.fillColor,
  this.checkColor,
  this.focusColor,
  this.hoverColor,
  this.overlayColor,
  this.splashRadius,
  this.materialTapTargetSize,
  this.visualDensity,
  this.focusNode,
  this.autofocus = false,
  this.shape,
  this.side,
}) : color = value == true ? labelCheckColor: labelColor,
      super(key: key);