NikuSwitch constructor
NikuSwitch(
- bool? value, {
- Key? key,
- NikuState<
Color?> ? thumbColorState, - NikuState<
Color?> ? trackColorState, - NikuState<
Icon?> ? thumbIconState, - NikuState<
Color?> ? overlayColorState, - ValueChanged<
bool> ? onChanged, - Color? activeColor,
- Color? activeTrackColor,
- Color? inactiveThumbColor,
- Color? inactiveTrackColor,
- ImageProvider<
Object> ? activeThumbImage, - ImageErrorListener? onActiveThumbImageError,
- ImageProvider<
Object> ? inactiveThumbImage, - ImageErrorListener? onInactiveThumbImageError,
- Color? thumbColor,
- Color? trackColor,
- MaterialTapTargetSize? materialTapTargetSize,
- DragStartBehavior? dragStartBehavior,
- MouseCursor? mouseCursor,
- Color? focusColor,
- Color? hoverColor,
- Color? overlayColor,
- double? splashRadius,
- FocusNode? focusNode,
- bool? autofocus,
- Icon? thumbIcon,
- bool adaptive = false,
- bool cupertino = false,
Implementation
NikuSwitch(
this.value, {
Key? key,
this.thumbColorState,
this.trackColorState,
this.thumbIconState,
this.overlayColorState,
this.onChanged,
this.activeColor,
this.activeTrackColor,
this.inactiveThumbColor,
this.inactiveTrackColor,
this.activeThumbImage,
this.onActiveThumbImageError,
this.inactiveThumbImage,
this.onInactiveThumbImageError,
Color? thumbColor,
Color? trackColor,
this.materialTapTargetSize,
this.dragStartBehavior,
this.mouseCursor,
this.focusColor,
this.hoverColor,
Color? overlayColor,
this.splashRadius,
this.focusNode,
this.autofocus,
Icon? thumbIcon,
this.adaptive = false,
this.cupertino = false,
}) : super(key: key) {
if (thumbColor != null) thumbColorState = NikuState.all(thumbColor);
if (trackColor != null) trackColorState = NikuState.all(trackColor);
if (overlayColor != null) overlayColorState = NikuState.all(overlayColor);
if (thumbIcon != null) thumbIconState = NikuState.all(thumbIcon);
}