Select constructor

Select({
  1. String? label,
  2. String? name,
  3. Object? value,
  4. String? placeholder,
  5. List<SelectOption> options = const [],
  6. bool required = false,
  7. bool disabled = false,
  8. InputVariant variant = InputVariant.outline,
  9. ComponentSize size = ComponentSize.md,
  10. String? error,
  11. FormErrors? errors,
  12. String? helpText,
  13. String? className,
  14. Map<String, Object?> props = const {},
  15. Map<String, Object?> selectProps = const {},
  16. Map<String, Object?> style = const {},
  17. Map<String, Object?> selectStyle = const {},
  18. DartStyle? dartStyle,
  19. DartStyle? selectDartStyle,
  20. void onChanged(
    1. Object event
    )?,
})

Creates a select field.

Implementation

Select({
  String? label,
  String? name,
  Object? value,
  String? placeholder,
  List<SelectOption> options = const [],
  bool required = false,
  bool disabled = false,
  InputVariant variant = InputVariant.outline,
  ComponentSize size = ComponentSize.md,
  String? error,
  FormErrors? errors,
  String? helpText,
  String? className,
  Map<String, Object?> props = const {},
  Map<String, Object?> selectProps = const {},
  Map<String, Object?> style = const {},
  Map<String, Object?> selectStyle = const {},
  DartStyle? dartStyle,
  DartStyle? selectDartStyle,
  void Function(Object event)? onChanged,
}) : super(
        'div',
        props: fieldWrapperProps(
          props: props,
          className: className,
          dartStyle: dartStyle,
          style: style,
        ),
        children: _children(
          label: label,
          name: name,
          value: value,
          placeholder: placeholder,
          options: options,
          required: required,
          disabled: disabled,
          variant: variant,
          size: size,
          error: resolveFieldError(name: name, error: error, errors: errors),
          helpText: helpText,
          selectProps: selectProps,
          selectStyle: selectStyle,
          selectDartStyle: selectDartStyle,
          onChanged: onChanged,
        ),
      );