StyledSwitch constructor

StyledSwitch({
  1. Key? key,
  2. required bool value,
  3. required ValueChanged<bool>? onChanged,
  4. required Style thumbStyle,
  5. Style? thumbHoveredStyle,
  6. Style? thumbSelectedStyle,
  7. Style? thumbDisabledStyle,
  8. required Style trackStyle,
  9. Style? trackSelectedStyle,
  10. Style? trackHoveredStyle,
  11. Style? trackDisabledStyle,
  12. Axis direction = Axis.horizontal,
  13. Curve curve = Curves.linear,
  14. Duration duration = const Duration(milliseconds: 100),
  15. Widget? thumbChild,
})

Implementation

StyledSwitch({
  Key? key,
  required this.value,
  required this.onChanged,
  required this.thumbStyle,
  this.thumbHoveredStyle,
  this.thumbSelectedStyle,
  this.thumbDisabledStyle,
  required this.trackStyle,
  this.trackSelectedStyle,
  this.trackHoveredStyle,
  this.trackDisabledStyle,
  this.direction = Axis.horizontal,
  this.curve = Curves.linear,
  this.duration = const Duration(milliseconds: 100),
  Widget? thumbChild,
}) {
  thumbChildBuilder = (context, state) {
    return thumbChild;
  };
}