feat(benefit_history): enhance layout of benefit history row with improved structure and styling
This commit is contained in:
@@ -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
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
if (history.notes != null && history.notes!.isNotEmpty)
|
||||||
|
Text(
|
||||||
|
history.notes!,
|
||||||
|
style: UiTypography.body2r,
|
||||||
|
),
|
||||||
|
const SizedBox(height: UiConstants.space2),
|
||||||
Text(
|
Text(
|
||||||
DateFormat('d MMM, yyyy').format(history.effectiveAt),
|
DateFormat('d MMM, yyyy').format(history.effectiveAt),
|
||||||
style: UiTypography.footnote1r.textSecondary,
|
style: UiTypography.footnote1r.textSecondary,
|
||||||
),
|
),
|
||||||
const SizedBox(width: UiConstants.space3),
|
],
|
||||||
// Notes (takes remaining space)
|
|
||||||
Expanded(
|
|
||||||
child: history.notes != null && history.notes!.isNotEmpty
|
|
||||||
? Text(
|
|
||||||
history.notes!,
|
|
||||||
style: UiTypography.body3r.textSecondary,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
maxLines: 1,
|
|
||||||
)
|
|
||||||
: const SizedBox.shrink(),
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: UiConstants.space2),
|
),
|
||||||
// Hours badge
|
const SizedBox(width: UiConstants.space3),
|
||||||
_buildHoursBadge(i18n),
|
// Right: status chip + hours badge
|
||||||
const SizedBox(width: UiConstants.space2),
|
Column(
|
||||||
// Status chip
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: <Widget>[
|
||||||
_buildStatusChip(i18n),
|
_buildStatusChip(i18n),
|
||||||
|
const SizedBox(height: UiConstants.space2),
|
||||||
|
_buildHoursBadge(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,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user