dialog 0.8.0 copy "dialog: ^0.8.0" to clipboard
dialog: ^0.8.0 copied to clipboard

Platformweb

Modern modal dialog implementation containing remakes of alert & confirm dialogs supplemented by prompt & custom modal dialogs

example/example.dart

import "dart:html";
import "package:dialog/dialog.dart";

void main() {
  querySelector("#alertButton")!.onClick.listen((_) {
    alert("Alerted?!");
  });
  querySelector("#confirmButton")!.onClick.listen((_) async {
    var myConfirm = await confirm("Confirmed?!");
    alert(myConfirm.toString());
  });
  querySelector("#promptButton")!.onClick.listen((_) async {
    var myPrompt = await prompt("Prompted?!", "Yes!");
    alert(myPrompt.toString());
  });
  querySelector("#modalButton")!.onClick.listen((_) async {
    var myModal = await modal(
        "Surprise", [Text("Boo!")], "Eek!", "Huh?", "Haha!", "Come on!", true);
    alert(myModal.toString());
  });
}
12
likes
150
pub points
77%
popularity

Publisher

unverified uploader

Modern modal dialog implementation containing remakes of alert & confirm dialogs supplemented by prompt & custom modal dialogs

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-2-Clause (license)

More

Packages that depend on dialog