Switcher.labelAndRounded constructor
Switcher.labelAndRounded({
- required bool value,
- required void onChange(
- bool value
- required String? label,
- TextStyle? labelStyle = const TextStyle(),
- MainAxisAlignment mainAxisAlignment = MainAxisAlignment.spaceBetween,
- Duration duration = const Duration(milliseconds: 100),
- double size = 24.0,
- Color? activeColor,
- Color? disableColor,
The named constructor called label that render a circle shaped Switcher
with a label
.
- 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.labelAndRounded({
required this.value,
required this.onChange,
required this.label,
this.labelStyle = const TextStyle(),
this.mainAxisAlignment = MainAxisAlignment.spaceBetween,
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 [label] is not null.
assert(label != null, 'The label variable must be seted'),
/// 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');