Skip to content

Commit d731338

Browse files
authored
Simplify design systems section on widget catalog index page (#12711)
This loop previously looped through items to render them but manually checked their values anyway. Instead of relying on harder to understand Liquid templating logic, just inline the intended cards. **Staged:** https://flutter-docs-prod--pr12711-misc-widget-catalog-index-s-dzp1gfca.web.app/ui/widgets#design-systems
1 parent 276f195 commit d731338

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

site/lib/src/components/common/card.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class Card extends StatelessComponent {
6262
],
6363
content: [?child],
6464
link: link,
65-
filled: link != null,
65+
filled: link != null && attributes['filled'] != 'false',
6666
outlined: outlined,
6767
);
6868
}

src/content/ui/widgets/index.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,25 @@ you can also see all the widgets in the [widget index][].
1414
Flutter ships with two design systems as part of the SDK.
1515

1616
<div class="card-grid">
17-
{% assign categories = catalog.index | sortBy: 'name' -%}
18-
{% for section in categories %}
19-
{%- if section.name == "Cupertino" or section.name == "Material components" -%}
20-
<a class="card outlined-card" href="{{page.url}}/{{section.id}}">
21-
<div class="card-header">
22-
<span class="card-title">{{section.name}}</span>
23-
</div>
24-
<div class="card-content">
25-
<p>{{section.description}}</p>
26-
</div>
27-
</a>
28-
{% endif -%}
29-
{% endfor %}
17+
<Card title="Cupertino" link="/ui/widgets/cupertino" outlined="true" filled="false">
18+
Beautiful and high-fidelity widgets that align with
19+
Apple's Human Interface Guidelines for iOS and macOS.
20+
</Card>
21+
<Card title="Material design" link="/ui/widgets/material" outlined="true" filled="false">
22+
Visual, behavioral, and motion-rich widgets implementing
23+
the Material 3 design specification.
24+
</Card>
3025
</div>
3126

32-
You can find many more designs systems created by the Flutter community
33-
on [pub.dev]({{site.pub}}), the package repository for Dart and Flutter,
34-
like for example the Windows-inspired [fluent_ui]({{site.pub-pkg}}/fluent_ui),
35-
macOS-inspired [macos_ui]({{site.pub-pkg}}/macos_ui),
36-
and the Ubuntu-inspired [yaru]({{site.pub-pkg}}/yaru) widgets.
27+
You can find many more design systems created by the Flutter community
28+
on [pub.dev]({{site.pub}}), the package repository for Dart and Flutter.
29+
For example, the Windows-inspired [fluent_ui][],
30+
macOS-inspired [macos_ui][],
31+
and the Ubuntu-inspired [yaru][] widgets.
32+
33+
[fluent_ui]: {{site.pub-pkg}}/fluent_ui
34+
[macos_ui]: {{site.pub-pkg}}/macos_ui
35+
[yaru]: {{site.pub-pkg}}/yaru
3736

3837
## Base widgets
3938

0 commit comments

Comments
 (0)