TextArea constructor

TextArea({
  1. String? label,
  2. String? name,
  3. TextEditingController? controller,
  4. Object? value,
  5. String? placeholder,
  6. int rows = 4,
  7. bool required = false,
  8. bool disabled = false,
  9. InputVariant variant = InputVariant.outline,
  10. ComponentSize size = ComponentSize.md,
  11. String? error,
  12. FormErrors? errors,
  13. String? helpText,
  14. String? className,
  15. Map<String, Object?> props = const {},
  16. Map<String, Object?> textareaProps = const {},
  17. Map<String, Object?> style = const {},
  18. Map<String, Object?> textareaStyle = const {},
  19. DartStyle? dartStyle,
  20. DartStyle? textareaDartStyle,
  21. void onChanged(
    1. Object event
    )?,
})

Creates a multiline text field.

Implementation

TextArea({
  String? label,
  String? name,
  TextEditingController? controller,
  Object? value,
  String? placeholder,
  int rows = 4,
  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?> textareaProps = const {},
  Map<String, Object?> style = const {},
  Map<String, Object?> textareaStyle = const {},
  DartStyle? dartStyle,
  DartStyle? textareaDartStyle,
  void Function(Object event)? onChanged,
}) : super(
        'div',
        props: fieldWrapperProps(
          props: props,
          className: className,
          dartStyle: dartStyle,
          style: style,
        ),
        children: _children(
          label: label,
          name: name,
          value: controller?.text ?? value,
          placeholder: placeholder,
          rows: rows,
          required: required,
          disabled: disabled,
          variant: variant,
          size: size,
          error: resolveFieldError(name: name, error: error, errors: errors),
          helpText: helpText,
          textareaProps: textareaProps,
          textareaStyle: textareaStyle,
          textareaDartStyle: textareaDartStyle,
          onChanged: _controlledOnChanged(controller, onChanged),
        ),
      );