input function

ElementNode input({
  1. Object? key,
  2. String type = 'text',
  3. String? value,
  4. String? placeholder,
  5. bool disabled = false,
  6. String? classes,
  7. Map<String, String>? style,
  8. EventCallback? onInput,
  9. Map<String, Attribute>? attrs,
})

Implementation

ElementNode input({
  Object? key,
  String type = 'text',
  String? value,
  String? placeholder,
  bool disabled = false,

  String? classes,
  Map<String, String>? style,
  EventCallback? onInput,
  Map<String, Attribute>? attrs,
}) {
  return el(
    'input',
    key: key,
    classes: classes,
    style: style,
    onClick: onInput,
    attrs: {
      'type': StringAttribute(type),
      if (value != null) 'value': StringAttribute(value),
      if (placeholder != null) 'placeholder': StringAttribute(placeholder),
      if (disabled) 'disabled': BooleanAttribute(true),
      ...?attrs,
    },
    children: const [],
  );
}