feat: Enhance AvailableOrderCard layout and time formatting
This commit is contained in:
@@ -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: <Widget>[
|
||||
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: <Widget>[
|
||||
Text(
|
||||
t.available_orders.shifts_count(
|
||||
count: schedule.totalShifts,
|
||||
),
|
||||
style: UiTypography.footnote2r.textSecondary,
|
||||
),
|
||||
if (schedule.timezone.isNotEmpty) ...<Widget>[
|
||||
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,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user