SwitchButton constructor

const SwitchButton({
  1. Key? key,
  2. SwitchConfig config = const SwitchConfig(),
  3. bool enabled = true,
  4. bool value = false,
  5. double size = 30,
  6. Color? activeThumbColor,
  7. Color? inactiveThumbColor,
  8. Color? activeThumbStrokeColor,
  9. Color? inactiveThumbStrokeColor,
  10. Color? activeTrackColor,
  11. Color? inactiveTrackColor,
  12. Color? activeTrackStrokeColor,
  13. Color? inactiveTrackStrokeColor,
  14. dynamic activeThumbIcon,
  15. dynamic inactiveThumbIcon,
  16. Color? activeThumbIconTint,
  17. Color? inactiveThumbIconTint,
  18. double? activeThumbSpacing,
  19. double? inactiveThumbSpacing,
  20. double? activeThumbStrokeSize,
  21. double? inactiveThumbStrokeSize,
  22. double? thumbIconSpacing,
  23. int thumbWalkingTime = 200,
  24. double? trackBorderRadius,
  25. double? trackStrokeSize,
  26. double trackRatio = 1.65,
  27. OnViewToggleListener? onToggle,
})

Implementation

const SwitchButton({
  super.key,
  this.config = const SwitchConfig(),
  this.enabled = true,
  this.value = false,
  this.size = 30,
  this.activeThumbColor,
  this.inactiveThumbColor,
  this.activeThumbStrokeColor,
  this.inactiveThumbStrokeColor,
  this.activeTrackColor,
  this.inactiveTrackColor,
  this.activeTrackStrokeColor,
  this.inactiveTrackStrokeColor,
  this.activeThumbIcon,
  this.inactiveThumbIcon,
  this.activeThumbIconTint,
  this.inactiveThumbIconTint,
  this.activeThumbSpacing,
  this.inactiveThumbSpacing,
  this.activeThumbStrokeSize,
  this.inactiveThumbStrokeSize,
  this.thumbIconSpacing,
  this.thumbWalkingTime = 200,
  this.trackBorderRadius,
  this.trackStrokeSize,
  this.trackRatio = 1.65,
  this.onToggle,
});