import 'package:mdl/mdl.dart'; main() { final Logger _logger = new Logger('dialog.Main'); registerMdl(); componentFactory().run().then((_) { final MaterialButton btnToast = MaterialButton.widget(dom.querySelector("#toast")); final MaterialButton btnWithAction = MaterialButton.widget(dom.querySelector("#withAction")); final MaterialToast toast = new MaterialToast(); int mangoCounter = 0; void _makeSettings() { toast.position.left = MaterialCheckbox.widget(dom.querySelector("#checkbox-left")).checked; toast.position.top = MaterialCheckbox.widget(dom.querySelector("#checkbox-top")).checked; toast.position.right = MaterialCheckbox.widget(dom.querySelector("#checkbox-right")).checked; toast.position.bottom = MaterialCheckbox.widget(dom.querySelector("#checkbox-bottom")).checked; dom.querySelector("#container").classes.toggle("mdl-toast-container", MaterialCheckbox.widget(dom.querySelector("#checkbox-use-container")).checked); } btnToast.onClick.listen( (_) { _logger.info("Click on Toast"); _makeSettings(); toast("Toast message").show().then((final MdlDialogStatus status) { _logger.info(status); }); }); btnWithAction.onClick.listen( (_) { _logger.info("Click on withAction"); _makeSettings(); toast("Toast message",confirmButton: "OK").show().then((final MdlDialogStatus status) { _logger.info(status); }); }); }); }