File tree Expand file tree Collapse file tree 5 files changed +25
-7
lines changed Expand file tree Collapse file tree 5 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 55
66 header {
77 padding : 1rem 1.2rem 1.2rem ;
8+ display : flex ;
9+ align-items : center ;
10+
11+ >div {
12+ flex : 1 ;
13+ color : var (--site-base-fgColor-alt );
14+ }
815
916 h3 {
1017 margin : 0 ;
1320 color : var (--site-base-fgColor );
1421 }
1522
16- span {
17- color : var (--site-base-fgColor-alt );
23+ .summary-card-completed {
24+ color : var (--site-alert-tip-color );
1825 }
1926 }
2027
Original file line number Diff line number Diff line change @@ -49,14 +49,20 @@ class SummaryCardComponent extends StatelessComponent {
4949 Component build (BuildContext context) {
5050 return div (classes: 'summary-card' , [
5151 header ([
52- h3 ([text (model.title)]),
53- if (model.subtitle case final subtitle? ) span ([text (subtitle)]),
52+ div ([
53+ h3 ([text (model.title)]),
54+ if (model.subtitle case final subtitle? ) span ([text (subtitle)]),
55+ ]),
56+ if (model.completed)
57+ span (classes: 'summary-card-completed' , [
58+ const MaterialIcon ('check_circle' ),
59+ ]),
5460 ]),
55- for (final item in model.items) buildSummaryItem (item),
61+ for (final item in model.items) _buildSummaryItem (item),
5662 ]);
5763 }
5864
59- Component buildSummaryItem (SummaryCardItem item) {
65+ Component _buildSummaryItem (SummaryCardItem item) {
6066 if (item.details case final d? ) {
6167 return details ([
6268 summary (classes: 'summary-card-item' , [
Original file line number Diff line number Diff line change @@ -8,18 +8,21 @@ class SummaryCardModel {
88 const SummaryCardModel ({
99 required this .title,
1010 this .subtitle,
11+ this .completed = false ,
1112 required this .items,
1213 });
1314
1415 final String title;
1516 final String ? subtitle;
17+ final bool completed;
1618 final List <SummaryCardItem > items;
1719
1820 @decoder
1921 factory SummaryCardModel .fromMap (Map <Object ?, Object ?> json) {
2022 return SummaryCardModel (
2123 title: json['title' ] as String ,
2224 subtitle: json['subtitle' ] as String ? ,
25+ completed: json['completed' ] as bool ? ?? false ,
2326 items: (json['items' ] as List <Object ?>)
2427 .map ((e) => SummaryCardItem .fromMap (e as Map <Object ?, Object ?>))
2528 .toList (),
@@ -30,6 +33,7 @@ class SummaryCardModel {
3033 Map <Object ?, Object ?> toJson () => {
3134 'title' : title,
3235 'subtitle' : subtitle,
36+ 'completed' : completed,
3337 'items' : items.map ((e) => e.toJson ()).toList (),
3438 };
3539}
Original file line number Diff line number Diff line change @@ -194,6 +194,7 @@ items:
194194<SummaryCard>
195195title: What you accomplished
196196subtitle: Here's a summary of what you accomplished in this lesson.
197+ completed: true
197198items:
198199 - title: Reviewed the core concepts of Flutter
199200 icon: flutter
Original file line number Diff line number Diff line change 22// dart format off
33
44/// The generated hash of the `main.css` file.
5- const generatedStylesHash = 'va3Vkb6epp+o ' ;
5+ const generatedStylesHash = 'xVbcnbykNQw/ ' ;
You can’t perform that action at this time.
0 commit comments