html static method

Component html({
  1. Map<String, String>? attributes,
})

Set attributes on the html element (e.g., dark/light class)

Implementation

static Component html({Map<String, String>? attributes}) {
  if (!_htmlInitialized && attributes != null) {
    _htmlInitialized = true;
    final web.HTMLElement htmlEl = web.document.documentElement as web.HTMLElement;
    for (final MapEntry<String, String> entry in attributes.entries) {
      htmlEl.setAttribute(entry.key, entry.value);
    }
  }
  return const Component.fragment([]);
}