widget method
Widget
widget(
- Color? activeColor,
- Color? inactiveColor,
- ValueChanged<
bool> onChanged, - bool value,
Implementation
Widget widget(
Color? activeColor,
Color? inactiveColor,
ValueChanged<bool> onChanged,
bool value,
) {
switch (this) {
case SwitchType.material:
return Switch(
value: value,
onChanged: onChanged,
activeColor: activeColor,
activeTrackColor: activeColor?.withOpacity(0.5),
);
case SwitchType.cupertino:
return CupertinoSwitch(
value: value,
onChanged: onChanged,
activeColor: activeColor,
);
default:
return CustomSwitch(
value: value,
onChanged: onChanged,
activeColor: activeColor,
inactiveColor: inactiveColor,
);
}
}