ToggleSwitch constructor
ToggleSwitch({
- Key? key,
- int? totalSwitches,
- List<
String> ? labels, - List<
bool> ? states, - List<
Color> ? borderColor, - double? borderWidth,
- Color dividerColor = Colors.white30,
- List<
Color> ? activeBgColor, - Color? activeFgColor,
- Color? inactiveBgColor,
- Color? inactiveFgColor,
- OnToggle? onToggle,
- CancelToggle? cancelToggle,
- double cornerRadius = 8.0,
- int? initialLabelIndex = 0,
- double minWidth = 72.0,
- double minHeight = 40.0,
- bool changeOnTap = true,
- List<
IconData?> ? icons, - List<
List< ? activeBgColors,Color> ?> - List<
TextStyle?> ? customTextStyles, - List<
Icon?> ? customIcons, - List<
double> ? customWidths, - List<
double> ? customHeights, - bool animate = false,
- int animationDuration = 800,
- Curve curve = Curves.easeIn,
- bool radiusStyle = false,
- bool textDirectionRTL = false,
- double fontSize = 14.0,
- double iconSize = 17.0,
- double? dividerMargin = 8.0,
- bool doubleTapDisable = false,
- bool isVertical = false,
- List<
Border?> ? activeBorders, - bool centerText = false,
- bool multiLineText = false,
- List<
Widget> ? customWidgets,
Implementation
ToggleSwitch({
Key? key,
this.totalSwitches,
this.labels,
this.states,
this.borderColor,
this.borderWidth,
this.dividerColor = Colors.white30,
this.activeBgColor,
this.activeFgColor,
this.inactiveBgColor,
this.inactiveFgColor,
this.onToggle,
this.cancelToggle,
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.customHeights,
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.dividerMargin = 8.0,
this.doubleTapDisable = false,
this.isVertical = false,
this.activeBorders,
this.centerText = false,
this.multiLineText = false,
this.customWidgets,
}) : super(key: key);