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", "est_total": "Est. Total",
"hours_label": "$count hours", "hours_label": "$count hours",
"location": "LOCATION", "location": "LOCATION",
"break": "BREAK",
"paid": "Paid",
"unpaid": "Unpaid",
"open_in_maps": "Open in Maps", "open_in_maps": "Open in Maps",
"job_description": "JOB DESCRIPTION", "job_description": "JOB DESCRIPTION",
"cancel_shift": "CANCEL SHIFT", "cancel_shift": "CANCEL SHIFT",

View File

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

View File

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