The package is not working yet. It waits for resolving several bugs listed in the Dart issue tracker. This is one of them. DialogElement class from the Dart spec hasn't got default constructor and therefore can't be called. (see #21181 in the Dart issue tracker)
NoSuchMethodError: method not found: 'DialogElement' Receiver: Type: class 'DialogElement' Arguments: ...
Code:
import 'dart:html'; import 'package:dialog/dialog.dart';
void main() { querySelector("#sample_text_id") ..text = "Click me!" ..onClick.listen(reverseText); }
void reverseText(MouseEvent event) { alert("teste"); }