feat(breaks): Add break duration and payment status to shift details

This commit is contained in:
Achintha Isuru
2026-02-16 13:31:21 -05:00
parent 9b6cad3bde
commit 55f62207a8
3 changed files with 77 additions and 33 deletions

View File

@@ -999,6 +999,9 @@
"est_total": "Est. Total",
"hours_label": "$count hours",
"location": "LOCATION",
"break": "BREAK",
"paid": "Paid",
"unpaid": "Unpaid",
"open_in_maps": "Open in Maps",
"job_description": "JOB DESCRIPTION",
"cancel_shift": "CANCEL SHIFT",

View File

@@ -999,6 +999,9 @@
"est_total": "Total est.",
"hours_label": "$count horas",
"location": "UBICACIÓN",
"break": "DESCANSO",
"paid": "Pagado",
"unpaid": "No pagado",
"open_in_maps": "Abrir en Mapas",
"job_description": "DESCRIPCIÓN DEL TRABAJO",
"cancel_shift": "CANCELAR TURNO",

View File

@@ -240,6 +240,40 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
const Divider(height: 1, thickness: 0.5),
// Stats Row (New)
Padding(
padding: const EdgeInsets.all(UiConstants.space5),
child: Row(
children: [
Expanded(
child: _buildStatCard(
UiIcons.dollar,
"\$${estimatedTotal.toStringAsFixed(0)}",
"Total",
),
),
const SizedBox(width: UiConstants.space4),
Expanded(
child: _buildStatCard(
UiIcons.dollar,
"\$${displayShift.hourlyRate.toStringAsFixed(0)}",
"Hourly Rate",
),
),
const SizedBox(width: UiConstants.space4),
Expanded(
child: _buildStatCard(
UiIcons.clock,
duration.toStringAsFixed(1),
"Hours",
),
),
],
),
),
const Divider(height: 1, thickness: 0.5),
// Date & Time Section
Padding(
padding: const EdgeInsets.all(UiConstants.space5),
@@ -248,7 +282,8 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
children: [
Text(
i18n.shift_date,
style: UiTypography.titleUppercase4b
style: UiTypography
.titleUppercase4b
.textSecondary,
),
const SizedBox(height: UiConstants.space2),
@@ -288,42 +323,44 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
],
),
),
const Divider(height: 1, thickness: 0.5),
// Stats Row (New)
Padding(
padding: const EdgeInsets.all(UiConstants.space5),
child: Row(
children: [
Expanded(
child: _buildStatCard(
UiIcons.dollar,
"\$${estimatedTotal.toStringAsFixed(0)}",
"Total",
// Break Section
if (displayShift.breakInfo != null &&
displayShift.breakInfo!.duration !=
BreakDuration.none) ...[
Padding(
padding: const EdgeInsets.all(UiConstants.space5),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"BREAK",
style: UiTypography.titleUppercase4b
.textSecondary,
),
),
const SizedBox(width: UiConstants.space4),
Expanded(
child: _buildStatCard(
UiIcons.dollar,
"\$${displayShift.hourlyRate.toStringAsFixed(0)}",
"Hourly Rate",
const SizedBox(height: UiConstants.space2),
Row(
children: [
const Icon(
UiIcons.breakIcon,
size: 20,
color: UiColors.primary,
),
const SizedBox(width: UiConstants.space2),
Text(
"${displayShift.breakInfo!.duration.minutes} min (${displayShift.breakInfo!.isBreakPaid ? 'Paid' : 'Unpaid'})",
style:
UiTypography.headline5m.textPrimary,
),
],
),
),
const SizedBox(width: UiConstants.space4),
Expanded(
child: _buildStatCard(
UiIcons.clock,
duration.toStringAsFixed(1),
"Hours",
),
),
],
],
),
),
),
const Divider(height: 1, thickness: 0.5),
const Divider(height: 1, thickness: 0.5),
],
// Location Section (New with Map)
Padding(
@@ -358,7 +395,8 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
).showSnackBar(
SnackBar(
content: Text(
displayShift.locationAddress
displayShift
.locationAddress
.isNotEmpty
? displayShift.locationAddress
: displayShift.location,