DDSSwitch constructor
const
DDSSwitch({
- Key? key,
- required bool value,
- required ValueChanged<
bool> onToggle, - Color? activeColor,
- Color? inactiveColor,
- SwitchShape shape = SwitchShape.circle,
- Color? activeTextColor,
- Color? inactiveTextColor,
- Color? toggleColor,
- Color? activeToggleColor,
- Color? inactiveToggleColor,
- double width = 70.0,
- double height = 35.0,
- double toggleSize = 25.0,
- double? valueFontSize = 16.0,
- double borderRadius = 20.0,
- double padding = 4.0,
- bool? showOnOff = false,
- String? activeText,
- String? inactiveText,
- FontWeight? activeTextFontWeight,
- FontWeight? inactiveTextFontWeight,
- BoxBorder? switchBorder,
- BoxBorder? activeSwitchBorder,
- BoxBorder? inactiveSwitchBorder,
- BoxBorder? toggleBorder,
- BoxBorder? activeToggleBorder,
- BoxBorder? inactiveToggleBorder,
- Icon? activeIcon,
- Icon? inactiveIcon,
- Duration duration = const Duration(milliseconds: 200),
- bool? disabled = false,
- 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);