el function
Implementation
ElementNode el(
String tag, {
Object? key,
Map<String, Attribute>? attrs,
String? classes,
Map<String, String>? style,
EventCallback? onClick,
Children children = const [],
}) {
final attributes = <String, Attribute>{};
if (classes != null) {
attributes['class'] = ClassAttribute(classes);
}
if (style != null) {
attributes['style'] = StyleAttribute(style);
}
if (onClick != null) {
attributes['onClick'] = EventAttribute(onClick);
}
if (attrs != null) {
attributes.addAll(attrs);
}
return ElementNode(
tag: tag,
key: key,
attributes: attributes,
children: children,
);
}