rnSwitch

External Documentation

RNSwitchElement rnSwitch({

  1. bool? value,
  2. void onValueChange(
    1. bool
    )?,
  3. String? trackColor,
  4. String? thumbColor,
  5. Map<String, dynamic>? props,
})

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));
}