Last night I made my Dart modal dialog class absolutely perfect. Well, at least as perfect as the
dart_analyzertool can help me make it.
But while messing around with it, I happened to stumble across the showModalDialog dialog method built into the
dart:htmllibrary. Based on the method signature, which requires a URL as the first argument, I doubt that I can bend it to my will—dynamically building awesome dialogs like:
Still, if there is a built-in approach to doing these things, it might be worth some investigation.
A bit of research shows that
showModalDialogis actually a HTML5 function. I have yet to come across that. Let's see what it can do in the world of Dart.
I replace my modal dialog call with
// ... // el = new ModalDialog(); var ret = window.showModalDialog('/test.html'); _attachUiHandlers(); // ...When I try to use this, I find nothing but a big, hairy stack trace:
Pfft. That's no modal. This seems to be a dead end. Even if the Dart version of
showModalDialog()worked and I could dynamically update the contents, it does not seem as though Chrome / Dartium supports it in a meaningful way. Oh well, at least I looked into it. And now I can stick with my own implementation with confidence.