From 64ae73ca920ed0d4734f7e1670eaac6575121272 Mon Sep 17 00:00:00 2001 From: Edouard Marquez Date: Sat, 25 May 2024 09:49:29 +0200 Subject: [PATCH] ScoreCardType as a public enum --- .../smooth_app/lib/cards/data_cards/score_card.dart | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/smooth_app/lib/cards/data_cards/score_card.dart b/packages/smooth_app/lib/cards/data_cards/score_card.dart index 65776f0d337..e45143d3bda 100644 --- a/packages/smooth_app/lib/cards/data_cards/score_card.dart +++ b/packages/smooth_app/lib/cards/data_cards/score_card.dart @@ -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); @@ -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 = @@ -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) { @@ -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), @@ -128,7 +128,7 @@ class ScoreCard extends StatelessWidget { } String _generateSemanticsValue(BuildContext context) { - if (type == _ScoreCardType.title) { + if (type == ScoreCardType.title) { return description; } @@ -142,7 +142,7 @@ class ScoreCard extends StatelessWidget { } } -enum _ScoreCardType { +enum ScoreCardType { title, attribute, }