site-www
site-www copied to clipboard
Add Documentation on redirecting factory constructor
The Language spec defines implementation for the following syntax:
factory Listenable.merge(List<Listenable> listenables) = _MergingListenable
This can be found in the Dart Language Specification, but not in the language tour. This syntax could be made more visible.
Related: https://github.com/flutter/flutter/issues/35727
Thanks for the issue, @shihaohong. I hadn't seen this syntax before.
This section of the language tour only shows the syntax for redirecting generative constructors.
https://github.com/dart-lang/site-www/blob/main/src/_guides/language/language-tour.md#redirecting-constructors
Looks like this can be added at this page location: https://dart.dev/language/constructors#factory-constructors