Switch constructor

Switch({
  1. String? label,
  2. String? name,
  3. bool checked = false,
  4. bool disabled = false,
  5. String? error,
  6. FormErrors? errors,
  7. String? helpText,
  8. String? className,
  9. Map<String, Object?> props = const {},
  10. Map<String, Object?> inputProps = const {},
  11. Map<String, Object?> style = const {},
  12. DartStyle? dartStyle,
  13. void onChanged(
    1. Object event
    )?,
})

Creates a switch field.

Implementation

Switch({
  String? label,
  String? name,
  bool checked = false,
  bool disabled = false,
  String? error,
  FormErrors? errors,
  String? helpText,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> inputProps = const {},
  Map<String, Object?> style = const {},
  DartStyle? dartStyle,
  void Function(Object event)? onChanged,
}) : super(
       label: label,
       name: name,
       checked: checked,
       disabled: disabled,
       error: error,
       errors: errors,
       helpText: helpText,
       className: className,
       props: props,
       inputProps: {
         ...inputProps,
         'role': 'switch',
         'aria-checked': checked.toString(),
       },
       style: style,
       dartStyle: dartStyle,
       onChanged: onChanged,
     );