SToggle constructor

const SToggle({
  1. Key? key,
  2. double size = 60.0,
  3. Color onColor = Colors.white,
  4. Color offColor = Colors.black87,
  5. bool value = false,
  6. Duration? animationDuration,
  7. dynamic onChange(
    1. bool value
    )?,
  8. double dragSensitivity = 0.85,
  9. double dragSmoothing = 0.1,
  10. bool debugShowPointers = false,
  11. bool animateBackground = true,
  12. double backgroundOpacity = 0.15,
  13. double borderWidth = 1.0,
  14. Color? borderColor,
  15. double littleBorderWidth = 0.0,
  16. Color? littleBorderColor,
  17. double littleShadowBlurSigma = 6.0,
  18. Offset littleShadowOffset = const Offset(0, 2),
  19. Color littleShadowColor = const Color(0x40000000),
})

Implementation

const SToggle({
  super.key,
  this.size = 60.0,
  this.onColor = Colors.white,
  this.offColor = Colors.black87,
  this.value = false,
  this.animationDuration,
  this.onChange,
  this.dragSensitivity = 0.85,
  this.dragSmoothing = 0.1,
  this.debugShowPointers = false,
  this.animateBackground = true,
  this.backgroundOpacity = 0.15,
  this.borderWidth = 1.0,
  this.borderColor,
  this.littleBorderWidth = 0.0,
  this.littleBorderColor,
  this.littleShadowBlurSigma = 6.0,
  this.littleShadowOffset = const Offset(0, 2),
  this.littleShadowColor = const Color(0x40000000),
})  : _width = size,
      _height = size / 2;