LabeledSwitch constructor
const
LabeledSwitch({
- Key? key,
- required String label,
- required bool value,
- required ValueChanged<
bool> ? onChanged, - MainAxisSize mainAxisSize = MainAxisSize.min,
- EdgeInsets? padding,
- double gap = 0.0,
- double? labelFontSize,
- FontWeight? labelFontWeight,
- Color? labelColor,
- Color? labelCheckColor,
- TextStyle? labelStyle,
- bool? labelSoftWrap,
- TextOverflow? labelOverflow,
- int? labelMaxLines,
- TextWidthBasis? labelTextWidthBasis,
- Color? activeColor,
- Color? activeTrackColor,
- Color? inactiveThumbColor,
- Color? inactiveTrackColor,
- ImageProvider<
Object> ? activeThumbImage, - ImageErrorListener? onActiveThumbImageError,
- ImageProvider<
Object> ? inactiveThumbImage, - ImageErrorListener? onInactiveThumbImageError,
- MaterialStateProperty<
Color?> ? thumbColor, - MaterialStateProperty<
Color?> ? trackColor, - MaterialTapTargetSize? materialTapTargetSize,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- MouseCursor? mouseCursor,
- Color? focusColor,
- Color? hoverColor,
- MaterialStateProperty<
Color?> ? overlayColor, - double? splashRadius,
- FocusNode? focusNode,
- 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);