rnSwitch
External Documentation
RNSwitchElement
rnSwitch(
Switch component
Implementation
RNSwitchElement rnSwitch({
bool? value,
void Function(bool)? onValueChange,
String? trackColor,
String? thumbColor,
Map<String, dynamic>? props,
}) {
final p = <String, dynamic>{};
if (value != null) p['value'] = value;
if (onValueChange != null) {
p['onValueChange'] = ((JSBoolean v) => onValueChange(v.toDart)).toJS;
}
if (trackColor != null) p['trackColor'] = trackColor;
if (thumbColor != null) p['thumbColor'] = thumbColor;
if (props != null) p.addAll(props);
return RNSwitchElement.fromJS(rnElement('Switch', props: p));
}