Skip to content

Commit

Permalink
ScoreCardType as a public enum
Browse files Browse the repository at this point in the history
  • Loading branch information
g123k committed May 25, 2024
1 parent add2a4d commit 64ae73c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/smooth_app/lib/cards/data_cards/score_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ScoreCard extends StatelessWidget {
required Attribute attribute,
required this.isClickable,
this.margin,
}) : type = _ScoreCardType.attribute,
}) : type = ScoreCardType.attribute,
iconUrl = attribute.iconUrl,
description = attribute.descriptionShort ?? attribute.description ?? '',
cardEvaluation = getCardEvaluationFromAttribute(attribute);
Expand All @@ -57,7 +57,7 @@ class ScoreCard extends StatelessWidget {
required TitleElement titleElement,
required this.isClickable,
this.margin,
}) : type = _ScoreCardType.title,
}) : type = ScoreCardType.title,
iconUrl = titleElement.iconUrl,
description = titleElement.title,
cardEvaluation =
Expand All @@ -68,7 +68,7 @@ class ScoreCard extends StatelessWidget {
final CardEvaluation cardEvaluation;
final bool isClickable;
final EdgeInsetsGeometry? margin;
final _ScoreCardType type;
final ScoreCardType type;

@override
Widget build(BuildContext context) {
Expand All @@ -88,7 +88,7 @@ class ScoreCard extends StatelessWidget {
return Semantics(
value: _generateSemanticsValue(context),
excludeSemantics: true,
header: type == _ScoreCardType.title,
header: type == ScoreCardType.title,
button: isClickable,
child: Padding(
padding: margin ?? const EdgeInsets.symmetric(vertical: SMALL_SPACE),
Expand Down Expand Up @@ -128,7 +128,7 @@ class ScoreCard extends StatelessWidget {
}

String _generateSemanticsValue(BuildContext context) {
if (type == _ScoreCardType.title) {
if (type == ScoreCardType.title) {
return description;
}

Expand All @@ -142,7 +142,7 @@ class ScoreCard extends StatelessWidget {
}
}

enum _ScoreCardType {
enum ScoreCardType {
title,
attribute,
}

0 comments on commit 64ae73c

Please sign in to comment.