ToggleSwitch constructor

ToggleSwitch({
  1. Key? key,
  2. required int totalSwitches,
  3. List<String>? labels,
  4. List<Color>? borderColor,
  5. double? borderWidth,
  6. Color dividerColor = Colors.white30,
  7. List<Color>? activeBgColor,
  8. Color? activeFgColor,
  9. Color? inactiveBgColor,
  10. Color? inactiveFgColor,
  11. OnToggle? onToggle,
  12. double cornerRadius = 8.0,
  13. int? initialLabelIndex = 0,
  14. double minWidth = 72.0,
  15. double minHeight = 40.0,
  16. bool changeOnTap = true,
  17. List<IconData?>? icons,
  18. List<List<Color>?>? activeBgColors,
  19. List<TextStyle?>? customTextStyles,
  20. List<Icon?>? customIcons,
  21. List<double>? customWidths,
  22. bool animate = false,
  23. int animationDuration = 800,
  24. Curve curve = Curves.easeIn,
  25. bool radiusStyle = false,
  26. bool textDirectionRTL = false,
  27. double fontSize = 14.0,
  28. double iconSize = 17.0,
  29. bool doubleTapDisable = false,
})

Implementation

ToggleSwitch(
    {Key? key,
    required this.totalSwitches,
    this.labels,
    this.borderColor,
    this.borderWidth,
    this.dividerColor = Colors.white30,
    this.activeBgColor,
    this.activeFgColor,
    this.inactiveBgColor,
    this.inactiveFgColor,
    this.onToggle,
    this.cornerRadius = 8.0,
    this.initialLabelIndex = 0,
    this.minWidth = 72.0,
    this.minHeight = 40.0,
    this.changeOnTap = true,
    this.icons,
    this.activeBgColors,
    this.customTextStyles,
    this.customIcons,
    this.customWidths,
    this.animate = false,
    this.animationDuration = 800,
    this.curve = Curves.easeIn,
    this.radiusStyle = false,
    this.textDirectionRTL = false,
    this.fontSize = 14.0,
    this.iconSize = 17.0,
    this.doubleTapDisable = false})
    : super(key: key);