DTToggle constructor

const DTToggle({
  1. Key? key,
  2. required ValueChanged<bool?> onChanged,
  3. required bool value,
  4. String? enabledText,
  5. String? disabledText,
  6. TextStyle? enabledTextStyle,
  7. Color? enabledThumbColor,
  8. Color? enabledTrackColor,
  9. TextStyle? disabledTextStyle,
  10. Color? disabledTrackColor,
  11. Color? disabledThumbColor,
  12. DTToggleType? type,
  13. BoxShape? boxShape,
  14. BorderRadius? borderRadius,
  15. Duration duration = const Duration(milliseconds: 400),
})

Creates toggle button to switch between states onChanged.

Implementation

const DTToggle(
    {Key? key,
      required this.onChanged,
      required this.value,
      this.enabledText,
      this.disabledText,
      this.enabledTextStyle,
      this.enabledThumbColor,
      this.enabledTrackColor,
      this.disabledTextStyle,
      this.disabledTrackColor,
      this.disabledThumbColor,
      this.type,
      this.boxShape,
      this.borderRadius,
      this.duration = const Duration(milliseconds: 400)})
    : super(key: key);