NikuSwitch constructor

NikuSwitch(
  1. bool? value, {
  2. Key? key,
  3. NikuState<Color?>? thumbColorState,
  4. NikuState<Color?>? trackColorState,
  5. NikuState<Icon?>? thumbIconState,
  6. NikuState<Color?>? overlayColorState,
  7. ValueChanged<bool>? onChanged,
  8. Color? activeColor,
  9. Color? activeTrackColor,
  10. Color? inactiveThumbColor,
  11. Color? inactiveTrackColor,
  12. ImageProvider<Object>? activeThumbImage,
  13. ImageErrorListener? onActiveThumbImageError,
  14. ImageProvider<Object>? inactiveThumbImage,
  15. ImageErrorListener? onInactiveThumbImageError,
  16. Color? thumbColor,
  17. Color? trackColor,
  18. MaterialTapTargetSize? materialTapTargetSize,
  19. DragStartBehavior? dragStartBehavior,
  20. MouseCursor? mouseCursor,
  21. Color? focusColor,
  22. Color? hoverColor,
  23. Color? overlayColor,
  24. double? splashRadius,
  25. FocusNode? focusNode,
  26. bool? autofocus,
  27. Icon? thumbIcon,
  28. bool adaptive = false,
  29. 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);
}