The Dart Style Guide recommends using constructors instead of static methods to create instances, given that "named constructors and factory constructors in Dart give you all of the flexibility of static methods in other languages, while still allowing the callsite to appear like a regular constructor invocation".
Is there a technical reason then, for having declared int.parse()
and double.parse()
as static methods rather than factory constructors?
More generally, what would be the guidelines for choosing to write a factory constructor over a static (factory) method in Dart?