Autogenerate src/_data/catalog/widgets.json
Entries in the Widget catalog and the Widget index, come from src/_data/catalog/widgets.json.
We've had a few issues open over the widget list because of errors and/or omissions (I fixed a handful last Friday). We know for sure that the list isn't representative of the Flutter 1.0 collection of widgets. We should consider autogenerating the data from, say Flutter sources (once we agree on a few dartdoc metadata tags, this should be relatively easy to do).
Yes, this would be good for keeping those pages up to date.
I like the idea. Depends on the metadata requirements, though. You means something like the following?
// A file in flutter/flutter
/// Blah blah blah widget.
///
/// [[catalog_widget]]
class CupertinoSliverRefreshControl extends Widget {
// ...
}
(Ignore the syntax for now. Just clarifying what you mean by metadata in dartdoc.)
Yes, something along those lines (though our tooling could be given enough smarts to be able to figure out which classes are widgets of interest -- along with an opt-out tag for those we want to exclude; such an approach usually reduces the annotation burden).
Btw, we already have a syntax in place, at least one that dartdoc understands and can potentially (pre-)process: the syntax is like that for Dart annotations, @foo. So it might even be something like this:
// A file in flutter/flutter
/// Blah blah blah widget.
///
/// @catalog(categories: ['aaa', 'bbb'], subcategories: ['xxx', 'yyy', ...])
class CupertinoSliverRefreshControl extends Widget {
// ...
}
Linking relevant issue https://github.com/flutter/website/issues/3320