MaterialSwitchData constructor
const
MaterialSwitchData({
- bool? value,
- ValueChanged<
bool> ? onChanged, - Key? widgetKey,
- bool isEnabled = true,
- Color? activeThumbColor,
- Color? activeTrackColor,
- Color? inactiveThumbColor,
- Color? inactiveTrackColor,
- Color? focusColor,
- ImageProvider<
Object> ? activeThumbImage, - ImageErrorListener? onActiveThumbImageError,
- ImageProvider<
Object> ? inactiveThumbImage, - ImageErrorListener? onInactiveThumbImageError,
- WidgetStateProperty<
Color?> ? trackOutlineColor, - WidgetStateProperty<
double?> ? trackOutlineWidth, - WidgetStateProperty<
Icon?> ? thumbIcon, - DragStartBehavior dragStartBehavior = kDefaultDragStartBehavior,
- WidgetStateProperty<
MouseCursor> ? mouseCursor, - FocusNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - bool autofocus = kDefaultAutofocus,
- WidgetStateProperty<
Color?> ? thumbColor, - WidgetStateProperty<
Color?> ? trackColor, - WidgetStateProperty<
Color?> ? overlayColor, - MaterialTapTargetSize? materialTapTargetSize,
- Color? hoverColor,
- double? splashRadius,
- EdgeInsetsGeometry? padding,
isEnabled is a convenience property for setting onChanged == null automatically.
mouseCursor is not proxied through a WidgetStateProperty for Switch. It is defined by matching the same template/behaviour.
Implementation
const MaterialSwitchData({
super.value,
super.onChanged,
super.widgetKey,
super.isEnabled,
super.activeThumbColor,
super.activeTrackColor,
super.inactiveThumbColor,
super.inactiveTrackColor,
super.focusColor,
super.activeThumbImage,
super.onActiveThumbImageError,
super.inactiveThumbImage,
super.onInactiveThumbImageError,
super.trackOutlineColor,
super.trackOutlineWidth,
super.thumbIcon,
super.dragStartBehavior,
super.mouseCursor,
super.focusNode,
super.onFocusChange,
super.autofocus,
this.thumbColor,
this.trackColor,
this.overlayColor,
this.materialTapTargetSize,
this.hoverColor,
this.splashRadius,
this.padding,
});