universal_html 2.0.8
universal_html: ^2.0.8 copied to clipboard

A 'dart:html' that works in all platforms, including Flutter and server-side. Eases cross-platform development and HTML / XML processing.

example/example.dart

import 'package:universal_html/html.dart';

void main() {
  // Create a DOM tree
  final divElement = DivElement();
  divElement.append(Element.tag('h1')
    ..classes.add('greeting')
    ..appendText('Hello world!'));

  // Print outer HTML
  print(divElement.outerHtml);
  // --> <div><h1>Hello world</h1></div>

  // Do a CSS query
  print(divElement.querySelector('div > .greeting')!.text);
  // --> Hello world
}
149
likes
130
pub points
97%
popularity

Publisher

dint.dev

A 'dart:html' that works in all platforms, including Flutter and server-side. Eases cross-platform development and HTML / XML processing.

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

async, charcode, collection, csslib, html, meta, source_span, typed_data, universal_io

More

Packages that depend on universal_html