feat(benefit_history): enhance layout of benefit history row with improved structure and styling

This commit is contained in:
Achintha Isuru
2026-03-18 17:45:42 -04:00
parent 597866fc99
commit f5699865f9

View File

@@ -22,30 +22,36 @@ class BenefitHistoryRow extends StatelessWidget {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: UiConstants.space2), padding: const EdgeInsets.symmetric(vertical: UiConstants.space2),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Date column // Left: notes + date
Text( Expanded(
DateFormat('d MMM, yyyy').format(history.effectiveAt), child: Column(
style: UiTypography.footnote1r.textSecondary, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
if (history.notes != null && history.notes!.isNotEmpty)
Text(
history.notes!,
style: UiTypography.body2r,
),
const SizedBox(height: UiConstants.space2),
Text(
DateFormat('d MMM, yyyy').format(history.effectiveAt),
style: UiTypography.footnote1r.textSecondary,
),
],
),
), ),
const SizedBox(width: UiConstants.space3), const SizedBox(width: UiConstants.space3),
// Notes (takes remaining space) // Right: status chip + hours badge
Expanded( Column(
child: history.notes != null && history.notes!.isNotEmpty crossAxisAlignment: CrossAxisAlignment.end,
? Text( children: <Widget>[
history.notes!, _buildStatusChip(i18n),
style: UiTypography.body3r.textSecondary, const SizedBox(height: UiConstants.space2),
overflow: TextOverflow.ellipsis, _buildHoursBadge(i18n),
maxLines: 1, ],
)
: const SizedBox.shrink(),
), ),
const SizedBox(width: UiConstants.space2),
// Hours badge
_buildHoursBadge(i18n),
const SizedBox(width: UiConstants.space2),
// Status chip
_buildStatusChip(i18n),
], ],
), ),
); );
@@ -56,7 +62,7 @@ class BenefitHistoryRow extends StatelessWidget {
final String label = '+${history.trackedHours}h'; final String label = '+${history.trackedHours}h';
return Text( return Text(
label, label,
style: UiTypography.footnote2b.copyWith(color: UiColors.textSuccess), style: UiTypography.footnote1r.textSecondary,
); );
} }