form function

ElementNode form({
  1. Object? key,
  2. String? action,
  3. String method = 'get',
  4. String? classes,
  5. Map<String, String>? style,
  6. EventCallback? onSubmit,
  7. Map<String, Attribute>? attrs,
  8. Children children = const [],
})

Implementation

ElementNode form({
  Object? key,
  String? action,
  String method = 'get',

  String? classes,
  Map<String, String>? style,
  EventCallback? onSubmit,
  Map<String, Attribute>? attrs,

  Children children = const [],
}) {
  return el(
    'form',
    key: key,
    classes: classes,
    style: style,
    onClick: onSubmit,
    attrs: {
      if (action != null) 'action': StringAttribute(action),
      'method': StringAttribute(method),
      ...?attrs,
    },
    children: children,
  );
}