incremental_dom_bindings 2.1.0+1 incremental_dom_bindings: ^2.1.0+1 copied to clipboard
Dart bindings for the Incremental DOM library. That's a JS library for updating DOM trees (real DOM, not virtual DOM).
import 'dart:html';
import 'package:incremental_dom_bindings/incremental_dom_bindings.dart';
void main() {
// query the element to patch
final root = querySelector('#root')!;
// patch the element
patch(root, (_) {
// open a div element with the attributes id and style
elementOpen('div', null, [
'id',
'testId',
'style',
{'color': 'red'}
]);
// add a text inside the div element
text('Hello World');
// close the div element
elementClose('div');
});
}