GFToggle constructor

const GFToggle({
  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. GFToggleType? type,
  13. BoxShape? boxShape,
  14. BorderRadius? borderRadius,
  15. Duration duration = const Duration(milliseconds: 400),
})

Creates toggle button to switch between states onChanged.

Implementation

const GFToggle(
    {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);