SwitcherWidget constructor

const SwitcherWidget({
  1. required double size,
  2. required double borderRadius,
  3. required bool selected,
  4. required Duration duration,
  5. Color? activeColor,
  6. Color? disableColor,
})

The default SwitcherWidget constructor.

  • size;
  • borderRadius;
  • selected;
  • duration;

Implementation

const SwitcherWidget({
  required this.size,
  required this.borderRadius,
  required this.selected,
  required this.duration,
  this.activeColor,
  this.disableColor,
}) :

      /// This is a inner variable to control the size background of `SwitcherWidget`.
      /// The value of this variable is equal to `size * (times) 1.8`.
      this._backgroundSize = size * 1.8;