KeepSwitch constructor
const
KeepSwitch({
- required bool value,
- required ValueChanged<
bool> ? onChanged, - Color? activeColor,
- Color inactiveColor = Colors.grey,
- String activeText = 'On',
- String inactiveText = 'Off',
- Color activeTextColor = Colors.white70,
- Color inactiveTextColor = Colors.white70,
- bool isSwitchDisabled = false,
- double switchHeight = 27,
- double switchWidth = 55,
- Color switchButtonColor = Colors.white,
- TogglerShape? togglerShape,
- BoxShape? boxShape,
- Key? key,
Implementation
const KeepSwitch({
required this.value,
required this.onChanged,
this.activeColor,
this.inactiveColor = Colors.grey,
this.activeText = 'On',
this.inactiveText = 'Off',
this.activeTextColor = Colors.white70,
this.inactiveTextColor = Colors.white70,
this.isSwitchDisabled = false,
this.switchHeight = 27,
this.switchWidth = 55,
this.switchButtonColor = Colors.white,
this.togglerShape,
this.boxShape,
Key? key,
}) : assert(
(boxShape != null && togglerShape == null) ||
(boxShape == null && togglerShape != null) ||
(boxShape == null && togglerShape == null),
"You can't provide both"),
super(key: key);