LabeledSwitch constructor

const LabeledSwitch({
  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. Color? activeColor,
  18. Color? activeTrackColor,
  19. Color? inactiveThumbColor,
  20. Color? inactiveTrackColor,
  21. ImageProvider<Object>? activeThumbImage,
  22. ImageErrorListener? onActiveThumbImageError,
  23. ImageProvider<Object>? inactiveThumbImage,
  24. ImageErrorListener? onInactiveThumbImageError,
  25. MaterialStateProperty<Color?>? thumbColor,
  26. MaterialStateProperty<Color?>? trackColor,
  27. MaterialTapTargetSize? materialTapTargetSize,
  28. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  29. MouseCursor? mouseCursor,
  30. Color? focusColor,
  31. Color? hoverColor,
  32. MaterialStateProperty<Color?>? overlayColor,
  33. double? splashRadius,
  34. FocusNode? focusNode,
  35. bool autofocus = false,
})

Implementation

const LabeledSwitch({
  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.activeColor,
  this.activeTrackColor,
  this.inactiveThumbColor,
  this.inactiveTrackColor,
  this.activeThumbImage,
  this.onActiveThumbImageError,
  this.inactiveThumbImage,
  this.onInactiveThumbImageError,
  this.thumbColor,
  this.trackColor,
  this.materialTapTargetSize,
  this.dragStartBehavior = DragStartBehavior.start,
  this.mouseCursor,
  this.focusColor,
  this.hoverColor,
  this.overlayColor,
  this.splashRadius,
  this.focusNode,
  this.autofocus = false,
}) : color = value == true ? labelCheckColor: labelColor,
      super(key: key);