CustomSwitch constructor
const
CustomSwitch({
- required bool value,
- required ValueChanged<
bool> ? onChanged, - Key? key,
- Color? activeColor,
- Color? activeTrackColor,
- Color? inactiveThumbColor,
- Color? inactiveTrackColor,
- ImageProvider<
Object> ? activeThumbImage, - ImageErrorListener? onActiveThumbImageError,
- ImageProvider<
Object> ? inactiveThumbImage, - ImageErrorListener? onInactiveThumbImageError,
- WidgetStateProperty<
Color?> ? thumbColor, - WidgetStateProperty<
Color?> ? trackColor, - WidgetStateProperty<
Color?> ? trackOutlineColor, - WidgetStateProperty<
double?> ? trackOutlineWidth, - WidgetStateProperty<
Icon?> ? thumbIcon, - MaterialTapTargetSize? materialTapTargetSize,
- MouseCursor? mouseCursor,
- Color? focusColor,
- Color? hoverColor,
- WidgetStateProperty<
Color?> ? overlayColor, - double? splashRadius,
- FocusNode? focusNode,
- ValueChanged<
bool> ? onFocusChange, - bool autofocus = false,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- bool? applyCupertinoTheme,
Switch 开关组件
Implementation
const CustomSwitch({
required this.value,
required this.onChanged,
super.key,
this.activeColor,
this.activeTrackColor,
this.inactiveThumbColor,
this.inactiveTrackColor,
this.activeThumbImage,
this.onActiveThumbImageError,
this.inactiveThumbImage,
this.onInactiveThumbImageError,
this.thumbColor,
this.trackColor,
this.trackOutlineColor,
this.trackOutlineWidth,
this.thumbIcon,
this.materialTapTargetSize,
this.mouseCursor,
this.focusColor,
this.hoverColor,
this.overlayColor,
this.splashRadius,
this.focusNode,
this.onFocusChange,
this.autofocus = false,
this.dragStartBehavior = DragStartBehavior.start,
this.applyCupertinoTheme,
});