Switcher.rounded constructor

Switcher.rounded({
  1. required bool value,
  2. required void onChange(
    1. bool value
    ),
  3. Duration duration = const Duration(milliseconds: 100),
  4. double size = 24.0,
  5. Color? activeColor,
  6. Color? disableColor,
})

The named constructor called rounded that render a circle shaped Switcher.

  • value: Default is It's required;
  • onChange: It's required;
  • duration: Default is Duration(milliseconds: 100);
  • size: Default is 24.0;
  • activeColor: Default is Theme.of(context).accentColor;
  • disableColor: Default is Theme.of(context).disabledColor;

Implementation

Switcher.rounded({
  required this.value,
  required this.onChange,
  this.duration = const Duration(milliseconds: 100),
  this.size = 24.0,
  this.activeColor,
  this.disableColor,
})  :

      /// Set shape to a `circle`.
      this._borderRadius = size * 2.66,

      /// Assert [size] is greater than or equal to `16.0`.
      assert(size >= 16.0, 'The size must be greater than or equal to 16.0');