DDSSwitch constructor

const DDSSwitch({
  1. Key? key,
  2. required bool value,
  3. required ValueChanged<bool> onToggle,
  4. Color? activeColor,
  5. Color? inactiveColor,
  6. SwitchShape shape = SwitchShape.circle,
  7. Color? activeTextColor,
  8. Color? inactiveTextColor,
  9. Color? toggleColor,
  10. Color? activeToggleColor,
  11. Color? inactiveToggleColor,
  12. double width = 70.0,
  13. double height = 35.0,
  14. double toggleSize = 25.0,
  15. double? valueFontSize = 16.0,
  16. double borderRadius = 20.0,
  17. double padding = 4.0,
  18. bool? showOnOff = false,
  19. String? activeText,
  20. String? inactiveText,
  21. FontWeight? activeTextFontWeight,
  22. FontWeight? inactiveTextFontWeight,
  23. BoxBorder? switchBorder,
  24. BoxBorder? activeSwitchBorder,
  25. BoxBorder? inactiveSwitchBorder,
  26. BoxBorder? toggleBorder,
  27. BoxBorder? activeToggleBorder,
  28. BoxBorder? inactiveToggleBorder,
  29. Icon? activeIcon,
  30. Icon? inactiveIcon,
  31. Duration duration = const Duration(milliseconds: 200),
  32. bool? disabled = false,
  33. List<BoxShadow>? toggleShadow,
})

Implementation

const DDSSwitch({
  Key? key,
  required this.value,
  required this.onToggle,
  this.activeColor,
  this.inactiveColor,
  this.shape = SwitchShape.circle,
  this.activeTextColor,
  this.inactiveTextColor,
  this.toggleColor,
  this.activeToggleColor,
  this.inactiveToggleColor,
  this.width = 70.0,
  this.height = 35.0,
  this.toggleSize = 25.0,
  this.valueFontSize = 16.0,
  this.borderRadius = 20.0,
  this.padding = 4.0,
  this.showOnOff = false,
  this.activeText,
  this.inactiveText,
  this.activeTextFontWeight,
  this.inactiveTextFontWeight,
  this.switchBorder,
  this.activeSwitchBorder,
  this.inactiveSwitchBorder,
  this.toggleBorder,
  this.activeToggleBorder,
  this.inactiveToggleBorder,
  this.activeIcon,
  this.inactiveIcon,
  this.duration = const Duration(milliseconds: 200),
  this.disabled = false,
  this.toggleShadow,
}) : super(key: key);