CustomAnimatedToggleSwitch<T extends Object?> constructor

const CustomAnimatedToggleSwitch<T extends Object?>({
  1. Key? key,
  2. required T current,
  3. required List<T> values,
  4. required CustomIconBuilder<T> iconBuilder,
  5. Duration animationDuration = const Duration(milliseconds: 500),
  6. Curve animationCurve = Curves.easeInOutCirc,
  7. Size indicatorSize = const Size(48.0, double.infinity),
  8. ChangeCallback<T>? onChanged,
  9. double spacing = 0.0,
  10. CustomSeparatorBuilder<T>? separatorBuilder,
  11. TapCallback<T>? onTap,
  12. FittingMode fittingMode = FittingMode.preventHorizontalOverlapping,
  13. CustomWrapperBuilder<T>? wrapperBuilder,
  14. CustomIndicatorBuilder<T>? foregroundIndicatorBuilder,
  15. CustomIndicatorBuilder<T>? backgroundIndicatorBuilder,
  16. IndicatorAppearingBuilder indicatorAppearingBuilder = _defaultIndicatorAppearingBuilder,
  17. double height = 50.0,
  18. IconArrangement iconArrangement = IconArrangement.row,
  19. bool iconsTappable = true,
  20. EdgeInsetsGeometry padding = EdgeInsets.zero,
  21. double minTouchTargetSize = 48.0,
  22. Duration dragStartDuration = const Duration(milliseconds: 200),
  23. Curve dragStartCurve = Curves.easeInOutCirc,
  24. TextDirection? textDirection,
  25. ToggleCursors cursors = const ToggleCursors(),
  26. bool? loading,
  27. Duration? loadingAnimationDuration,
  28. Curve? loadingAnimationCurve,
  29. Duration indicatorAppearingDuration = _defaultIndicatorAppearingAnimationDuration,
  30. Curve indicatorAppearingCurve = _defaultIndicatorAppearingAnimationCurve,
  31. bool allowUnlistedValues = false,
  32. bool active = true,
  33. PositionListener<T>? positionListener,
})

Implementation

const CustomAnimatedToggleSwitch({
  Key? key,
  required this.current,
  required this.values,
  required this.iconBuilder,
  this.animationDuration = const Duration(milliseconds: 500),
  this.animationCurve = Curves.easeInOutCirc,
  this.indicatorSize = const Size(48.0, double.infinity),
  this.onChanged,
  this.spacing = 0.0,
  this.separatorBuilder,
  this.onTap,
  this.fittingMode = FittingMode.preventHorizontalOverlapping,
  this.wrapperBuilder,
  this.foregroundIndicatorBuilder,
  this.backgroundIndicatorBuilder,
  this.indicatorAppearingBuilder = _defaultIndicatorAppearingBuilder,
  this.height = 50.0,
  this.iconArrangement = IconArrangement.row,
  this.iconsTappable = true,
  this.padding = EdgeInsets.zero,
  this.minTouchTargetSize = 48.0,
  this.dragStartDuration = const Duration(milliseconds: 200),
  this.dragStartCurve = Curves.easeInOutCirc,
  this.textDirection,
  this.cursors = const ToggleCursors(),
  this.loading,
  this.loadingAnimationDuration,
  this.loadingAnimationCurve,
  this.indicatorAppearingDuration =
      _defaultIndicatorAppearingAnimationDuration,
  this.indicatorAppearingCurve = _defaultIndicatorAppearingAnimationCurve,
  this.allowUnlistedValues = false,
  this.active = true,
  this.positionListener,
})  : assert(foregroundIndicatorBuilder != null ||
          backgroundIndicatorBuilder != null),
      assert(separatorBuilder == null ||
          (spacing > 0 && iconArrangement == IconArrangement.row)),
      super(key: key);