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,22 +73,23 @@ class CoverageDashboard extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text("Today's Status", style: UiTypography.body1m.textSecondary),
Container(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2,
vertical: 2.0,
),
decoration: BoxDecoration(
color: coverageBadgeColor,
borderRadius: UiConstants.radiusMd,
),
child: Text(
'$coveragePercent% Covered',
style: UiTypography.footnote1b.copyWith(
color: coverageTextColor,
if (totalNeeded > 0 || totalConfirmed > 0)
Container(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2,
vertical: 2.0,
),
decoration: BoxDecoration(
color: coverageBadgeColor,
borderRadius: UiConstants.radiusMd,
),
child: Text(
'$coveragePercent% Covered',
style: UiTypography.footnote1b.copyWith(
color: coverageTextColor,
),
),
),
),
],
),
const SizedBox(height: UiConstants.space4),

View File

@@ -53,30 +53,26 @@ class CoverageWidget extends StatelessWidget {
letterSpacing: 0.5,
),
),
Container(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2,
vertical:
2, // 2px is not in metrics, using hardcoded for small tweaks or space0/space1
),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: UiConstants.radiusLg,
),
child: Text(
'$coveragePercent% Covered',
style: UiTypography.footnote2b.copyWith(
color: textColor,
if (totalNeeded > 0 || totalConfirmed > 0 || coveragePercent > 0)
Container(
padding: const EdgeInsets.symmetric(
horizontal: UiConstants.space2,
vertical:
2, // 2px is not in metrics, using hardcoded for small tweaks or space0/space1
),
decoration: BoxDecoration(
color: backgroundColor,
borderRadius: UiConstants.radiusLg,
),
child: Text(
'$coveragePercent% Covered',
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,15 +86,16 @@ class CoverageWidget extends StatelessWidget {
),
),
const SizedBox(width: UiConstants.space2),
if (totalConfirmed != 0) Expanded(
child: _MetricCard(
icon: UiIcons.success,
iconColor: UiColors.iconSuccess,
label: 'Filled',
value: '$totalConfirmed',
valueColor: UiColors.textSuccess,
if (totalConfirmed != 0)
Expanded(
child: _MetricCard(
icon: UiIcons.success,
iconColor: UiColors.iconSuccess,
label: 'Filled',
value: '$totalConfirmed',
valueColor: UiColors.textSuccess,
),
),
),
const SizedBox(width: UiConstants.space2),
Expanded(
child: _MetricCard(