Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 525 Bytes

README.md

File metadata and controls

22 lines (18 loc) · 525 Bytes

static_dom

A simple static HTML DOM builder library for Dart

Usage

A simple usage example:

Future updatePics() async {
  final JsonResponse resp = await client.getJson('/api/pics');
  print(resp.body);
  List<String> body = resp.body;
  Div divEl = div().forEach<String>(
      data,
      (String text) => div(classes: ['item'])
        ..add(img('/data/img/$text', classes: ["item-img"]))
        ..add(t(text, classes: ["item-txt"])));
  print(div.render());
  picHolder.setInnerHtml(div.render());
}