Skip to content

Commit

Permalink
Replace hasDisplayedCategories with hasCategoryNames. (#2614)
Browse files Browse the repository at this point in the history
Sometimes this partial is used for ModelFunctionTyped objects which don't
necessarily mix in Categorization, like ModelFunctionTypedef, so no
`hasDisplayedCategories` method is available.

This was the last usage of this method so I delete it as well.

`_categorization.html` already just used `hasCategoryNames`.
  • Loading branch information
srawlins committed Apr 12, 2021
1 parent 6295a19 commit 28c1d71
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
7 changes: 0 additions & 7 deletions lib/src/generator/templates.renderers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8795,13 +8795,6 @@ class _Renderer_Categorization extends RendererBase<Categorization> {
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.hasCategoryNames == true,
),
'hasDisplayedCategories': Property(
getValue: (CT_ c) => c.hasDisplayedCategories,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.hasDisplayedCategories == true,
),
'hasImage': Property(
getValue: (CT_ c) => c.hasImage,
renderVariable: (CT_ c, Property<CT_> self,
Expand Down
2 changes: 0 additions & 2 deletions lib/src/model/categorization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ abstract class Categorization implements ModelElement {
return categories.where((c) => c.isDocumented);
}

bool get hasDisplayedCategories => displayedCategories.isNotEmpty;

/// True if categories, subcategories, a documentation icon, or samples were
/// declared.
bool get hasCategorization {
Expand Down
4 changes: 2 additions & 2 deletions lib/templates/md/_categorization.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#hasDisplayedCategories}}
{{#hasCategoryNames}}
Categories:
{{#displayedCategories}}
{{{categoryLabel}}}
{{/displayedCategories}}
{{/hasDisplayedCategories}}
{{/hasCategoryNames}}

0 comments on commit 28c1d71

Please sign in to comment.