KeepSwitch constructor

const KeepSwitch({
  1. required bool value,
  2. required ValueChanged<bool>? onChanged,
  3. Color? activeColor,
  4. Color inactiveColor = Colors.grey,
  5. String activeText = 'On',
  6. String inactiveText = 'Off',
  7. Color activeTextColor = Colors.white70,
  8. Color inactiveTextColor = Colors.white70,
  9. bool isSwitchDisabled = false,
  10. double switchHeight = 27,
  11. double switchWidth = 55,
  12. Color switchButtonColor = Colors.white,
  13. TogglerShape? togglerShape,
  14. BoxShape? boxShape,
  15. 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);