From 833cb99f6bef835beb56c92aba98d1520c009323 Mon Sep 17 00:00:00 2001 From: Achintha Isuru Date: Thu, 19 Mar 2026 13:43:39 -0400 Subject: [PATCH] feat: Enhance AvailableOrderCard layout and time formatting --- .../widgets/available_order_card.dart | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/available_order_card.dart b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/available_order_card.dart index 63b6f498..fa64c9af 100644 --- a/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/available_order_card.dart +++ b/apps/mobile/packages/features/staff/shifts/lib/src/presentation/widgets/available_order_card.dart @@ -74,14 +74,15 @@ class AvailableOrderCard extends StatelessWidget { '\$${order.hourlyRate.toStringAsFixed(order.hourlyRate.truncateToDouble() == order.hourlyRate ? 0 : 2)}'; final String dateRange = '${_formatDateShort(schedule.startDate)} - ${_formatDateShort(schedule.endDate)}'; - final String timeRange = '${schedule.startTime} - ${schedule.endTime}'; + final String timeRange = + '${DateFormat('h:mm a').format(schedule.firstShiftStartsAt)} - ${DateFormat('h:mm a').format(schedule.lastShiftEndsAt)}'; return Container( margin: const EdgeInsets.only(bottom: UiConstants.space3), decoration: BoxDecoration( color: UiColors.white, borderRadius: UiConstants.radiusLg, - border: Border.all(color: UiColors.border), + border: Border.all(color: UiColors.border, width: 0.5), ), child: Padding( padding: const EdgeInsets.all(UiConstants.space4), @@ -194,7 +195,7 @@ class AvailableOrderCard extends StatelessWidget { if (order.locationAddress.isNotEmpty) Padding( padding: - const EdgeInsets.only(bottom: UiConstants.space2), + const EdgeInsets.only(bottom: UiConstants.space4), child: Padding( padding: const EdgeInsets.only( left: UiConstants.iconXs + UiConstants.space1, @@ -208,6 +209,7 @@ class AvailableOrderCard extends StatelessWidget { ), ), + // Schedule: days of week chips if (schedule.daysOfWeek.isNotEmpty) Padding( @@ -225,50 +227,48 @@ class AvailableOrderCard extends StatelessWidget { ), // Date range + time + shifts count - Row( + Column( children: [ - const Icon( - UiIcons.calendar, - size: UiConstants.iconXs, - color: UiColors.iconSecondary, + const SizedBox(height: UiConstants.space2), + Row( + children: [ + const Icon( + UiIcons.calendar, + size: UiConstants.iconXs, + color: UiColors.iconSecondary, + ), + const SizedBox(width: UiConstants.space1), + Text( + dateRange, + style: UiTypography.footnote1r.textSecondary, + ), + ], ), - const SizedBox(width: UiConstants.space1), - Text( - dateRange, - style: UiTypography.footnote1r.textSecondary, - ), - const SizedBox(width: UiConstants.space3), - const Icon( - UiIcons.clock, - size: UiConstants.iconXs, - color: UiColors.iconSecondary, - ), - const SizedBox(width: UiConstants.space1), - Text( - timeRange, - style: UiTypography.footnote1r.textSecondary, + const SizedBox(width: UiConstants.space2), + Row( + children: [ + const Icon( + UiIcons.clock, + size: UiConstants.iconXs, + color: UiColors.iconSecondary, + ), + const SizedBox(width: UiConstants.space1), + Text( + timeRange, + style: UiTypography.footnote1r.textSecondary, + ), + ], ), ], ), const SizedBox(height: UiConstants.space1), - // Total shifts + timezone - Row( - children: [ - Text( - t.available_orders.shifts_count( - count: schedule.totalShifts, - ), - style: UiTypography.footnote2r.textSecondary, - ), - if (schedule.timezone.isNotEmpty) ...[ - const SizedBox(width: UiConstants.space2), - Text( - schedule.timezone, - style: UiTypography.footnote2r.textSecondary, - ), - ], - ], + // Total shifts count + Text( + t.available_orders.shifts_count( + count: schedule.totalShifts, + ), + style: UiTypography.footnote2r.textSecondary, ), ], ),