That works, but the factory constructor is more ceremony than Dart requires. In fact, I can use a redirecting constructor, as Kasper Lund pointed out. Thus I can still instantiate simple modal dialogs the same way if I change the constructor to:

That is some compact syntax—the vanilla ModalDialog() constructor redirects to the ModalDialog.tag() constructor with an argument of 'div'. I really like that.

Something else that Kasper mentioned was that redirection also works in constant constructors. Upon hearing that, I could only wonder what the heck is a constant constructor? To answer that, I return to my Player class:

The problem is that new Player.xy(25, 25) is not a compile time constant. I can declare the me variable in a Dart libraries scope, but I cannot assign it—unless the assignment is a constant expression. Actual assignment is deferred until runtime (e.g. inside the main() function).

To convert Player into a compile time constant, I need to make all instance variables final:

class Player {
final int x, y;
// ...
}

Admittedly, there is not much sense to a game in which all player positions are final, but why let that get in the way of a good topic exploration?

In addition to final instance variables, I also need a constant constructor. Here, I use a redirecting, constant constructor to point the vanilla Player() to the Player.xy() version:

final me = const Player();
main() {
// Not much to do here since players don't move
}

Clearly I need a better use-case for constant objects that an immovable Player if I am to include a treatment of this topic in Dart for Hipsters. And I do need to include it—these redirecting constructors are quite nice.