universal_html 1.0.13 universal_html: ^1.0.13 copied to clipboard
Cross-platform 'dart:html'. Works in browser, server-side, and Flutter.
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
}