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,
children: <Widget>[
Text("Today's Status", style: UiTypography.body1m.textSecondary),
if (totalNeeded > 0 || totalConfirmed > 0)
Container(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2,

View File

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