tag<A, B> method

DomComponent<A, B> tag<A, B>([
  1. A? first,
  2. B? second
])

Creates a custom DomComponent using this string as the tag name.

Positional arguments are detected by their types: Map<String, String> -> attributes Iterable

Example:

"my-tag".tag({'class': 'demo'}, [Text('Hello')]);
"my-tag".tag([Text('Hello')], {'class': 'demo'}); // Also works!

Implementation

DomComponent<A, B> tag<A, B>([A? first, B? second]) {
  return CustomDomComponent<A, B>(this, first, second);
}