universal_html 1.1.7 universal_html: ^1.1.7 copied to clipboard
Cross-platform 'dart:html' that works in the browser, Dart VM, 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
}