feat: update coverage display logic to show status only when applicable

This commit is contained in:
Achintha Isuru
2026-02-02 21:55:33 -05:00
parent 2f6ad5578e
commit 81a9e2cfb0
2 changed files with 39 additions and 41 deletions

View File

@@ -73,6 +73,7 @@ class CoverageDashboard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Text("Today's Status", style: UiTypography.body1m.textSecondary), Text("Today's Status", style: UiTypography.body1m.textSecondary),
if (totalNeeded > 0 || totalConfirmed > 0)
Container( Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2, horizontal: UiConstants.space2,

View File

@@ -53,6 +53,7 @@ class CoverageWidget extends StatelessWidget {
letterSpacing: 0.5, letterSpacing: 0.5,
), ),
), ),
if (totalNeeded > 0 || totalConfirmed > 0 || coveragePercent > 0)
Container( Container(
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2, horizontal: UiConstants.space2,
@@ -65,18 +66,13 @@ class CoverageWidget extends StatelessWidget {
), ),
child: Text( child: Text(
'$coveragePercent% Covered', '$coveragePercent% Covered',
style: UiTypography.footnote2b.copyWith( style: UiTypography.footnote2b.copyWith(color: textColor),
color: textColor,
),
), ),
), ),
], ],
), ),
if (subtitle != null) ...<Widget>[ if (subtitle != null) ...<Widget>[
Text( Text(subtitle!, style: UiTypography.body2r.textSecondary),
subtitle!,
style: UiTypography.body2r.textSecondary,
),
], ],
const SizedBox(height: UiConstants.space6), const SizedBox(height: UiConstants.space6),
Row( Row(
@@ -90,7 +86,8 @@ class CoverageWidget extends StatelessWidget {
), ),
), ),
const SizedBox(width: UiConstants.space2), const SizedBox(width: UiConstants.space2),
if (totalConfirmed != 0) Expanded( if (totalConfirmed != 0)
Expanded(
child: _MetricCard( child: _MetricCard(
icon: UiIcons.success, icon: UiIcons.success,
iconColor: UiColors.iconSuccess, iconColor: UiColors.iconSuccess,