Skip to content

Commit 28c1d71

Browse files
authored
Replace hasDisplayedCategories with hasCategoryNames. (#2614)
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`.
1 parent 6295a19 commit 28c1d71

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

lib/src/generator/templates.renderers.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8795,13 +8795,6 @@ class _Renderer_Categorization extends RendererBase<Categorization> {
87958795
self.renderSimpleVariable(c, remainingNames, 'bool'),
87968796
getBool: (CT_ c) => c.hasCategoryNames == true,
87978797
),
8798-
'hasDisplayedCategories': Property(
8799-
getValue: (CT_ c) => c.hasDisplayedCategories,
8800-
renderVariable: (CT_ c, Property<CT_> self,
8801-
List<String> remainingNames) =>
8802-
self.renderSimpleVariable(c, remainingNames, 'bool'),
8803-
getBool: (CT_ c) => c.hasDisplayedCategories == true,
8804-
),
88058798
'hasImage': Property(
88068799
getValue: (CT_ c) => c.hasImage,
88078800
renderVariable: (CT_ c, Property<CT_> self,

lib/src/model/categorization.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,6 @@ abstract class Categorization implements ModelElement {
117117
return categories.where((c) => c.isDocumented);
118118
}
119119

120-
bool get hasDisplayedCategories => displayedCategories.isNotEmpty;
121-
122120
/// True if categories, subcategories, a documentation icon, or samples were
123121
/// declared.
124122
bool get hasCategorization {

lib/templates/md/_categorization.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{{#hasDisplayedCategories}}
1+
{{#hasCategoryNames}}
22
Categories:
33
{{#displayedCategories}}
44
{{{categoryLabel}}}
55
{{/displayedCategories}}
6-
{{/hasDisplayedCategories}}
6+
{{/hasCategoryNames}}

0 commit comments

Comments
 (0)