feat: Enhance AvailableOrderCard layout and time formatting

This commit is contained in:
Achintha Isuru
2026-03-19 13:43:39 -04:00
parent 96056d0170
commit 833cb99f6b

View File

@@ -74,14 +74,15 @@ class AvailableOrderCard extends StatelessWidget {
'\$${order.hourlyRate.toStringAsFixed(order.hourlyRate.truncateToDouble() == order.hourlyRate ? 0 : 2)}'; '\$${order.hourlyRate.toStringAsFixed(order.hourlyRate.truncateToDouble() == order.hourlyRate ? 0 : 2)}';
final String dateRange = final String dateRange =
'${_formatDateShort(schedule.startDate)} - ${_formatDateShort(schedule.endDate)}'; '${_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( return Container(
margin: const EdgeInsets.only(bottom: UiConstants.space3), margin: const EdgeInsets.only(bottom: UiConstants.space3),
decoration: BoxDecoration( decoration: BoxDecoration(
color: UiColors.white, color: UiColors.white,
borderRadius: UiConstants.radiusLg, borderRadius: UiConstants.radiusLg,
border: Border.all(color: UiColors.border), border: Border.all(color: UiColors.border, width: 0.5),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(UiConstants.space4), padding: const EdgeInsets.all(UiConstants.space4),
@@ -194,7 +195,7 @@ class AvailableOrderCard extends StatelessWidget {
if (order.locationAddress.isNotEmpty) if (order.locationAddress.isNotEmpty)
Padding( Padding(
padding: padding:
const EdgeInsets.only(bottom: UiConstants.space2), const EdgeInsets.only(bottom: UiConstants.space4),
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: UiConstants.iconXs + UiConstants.space1, left: UiConstants.iconXs + UiConstants.space1,
@@ -208,6 +209,7 @@ class AvailableOrderCard extends StatelessWidget {
), ),
), ),
// Schedule: days of week chips // Schedule: days of week chips
if (schedule.daysOfWeek.isNotEmpty) if (schedule.daysOfWeek.isNotEmpty)
Padding( Padding(
@@ -225,8 +227,11 @@ class AvailableOrderCard extends StatelessWidget {
), ),
// Date range + time + shifts count // Date range + time + shifts count
Row( Column(
children: <Widget>[ children: <Widget>[
const SizedBox(height: UiConstants.space2),
Row(
children: [
const Icon( const Icon(
UiIcons.calendar, UiIcons.calendar,
size: UiConstants.iconXs, size: UiConstants.iconXs,
@@ -237,7 +242,11 @@ class AvailableOrderCard extends StatelessWidget {
dateRange, dateRange,
style: UiTypography.footnote1r.textSecondary, style: UiTypography.footnote1r.textSecondary,
), ),
const SizedBox(width: UiConstants.space3), ],
),
const SizedBox(width: UiConstants.space2),
Row(
children: [
const Icon( const Icon(
UiIcons.clock, UiIcons.clock,
size: UiConstants.iconXs, size: UiConstants.iconXs,
@@ -250,26 +259,17 @@ class AvailableOrderCard extends StatelessWidget {
), ),
], ],
), ),
],
),
const SizedBox(height: UiConstants.space1), const SizedBox(height: UiConstants.space1),
// Total shifts + timezone // Total shifts count
Row(
children: <Widget>[
Text( Text(
t.available_orders.shifts_count( t.available_orders.shifts_count(
count: schedule.totalShifts, count: schedule.totalShifts,
), ),
style: UiTypography.footnote2r.textSecondary, style: UiTypography.footnote2r.textSecondary,
), ),
if (schedule.timezone.isNotEmpty) ...<Widget>[
const SizedBox(width: UiConstants.space2),
Text(
schedule.timezone,
style: UiTypography.footnote2r.textSecondary,
),
],
],
),
], ],
), ),
), ),