feat: Update AvailableOrderCard to display pay details for long-term orders

This commit is contained in:
Achintha Isuru
2026-03-19 13:49:22 -04:00
parent 24ff8816d2
commit 742c8c75c5

View File

@@ -85,6 +85,7 @@ class AvailableOrderCard extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final AvailableOrderSchedule schedule = order.schedule; final AvailableOrderSchedule schedule = order.schedule;
final int spotsLeft = order.requiredWorkerCount - order.filledCount; final int spotsLeft = order.requiredWorkerCount - order.filledCount;
final bool isLongTerm = order.orderType == OrderType.permanent;
final double durationHours = _durationHours(); final double durationHours = _durationHours();
final double estimatedTotal = order.hourlyRate * durationHours; final double estimatedTotal = order.hourlyRate * durationHours;
final String dateRange = final String dateRange =
@@ -135,7 +136,7 @@ class AvailableOrderCard extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
// Role name + estimated total // Role name + pay headline
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
spacing: UiConstants.space1, spacing: UiConstants.space1,
@@ -148,12 +149,14 @@ class AvailableOrderCard extends StatelessWidget {
), ),
), ),
Text( Text(
'\$${estimatedTotal.toStringAsFixed(0)}', isLongTerm
? '\$${order.hourlyRate.toInt()}/hr'
: '\$${estimatedTotal.toStringAsFixed(0)}',
style: UiTypography.title1m.textPrimary, style: UiTypography.title1m.textPrimary,
), ),
], ],
), ),
// Time subtitle + hourly rate // Time subtitle + pay detail
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
spacing: UiConstants.space1, spacing: UiConstants.space1,
@@ -162,10 +165,11 @@ class AvailableOrderCard extends StatelessWidget {
timeRange, timeRange,
style: UiTypography.body3r.textSecondary, style: UiTypography.body3r.textSecondary,
), ),
Text( if (!isLongTerm)
'\$${order.hourlyRate.toInt()}/hr \u00b7 ${durationHours.toInt()}h', Text(
style: UiTypography.footnote2r.textSecondary, '\$${order.hourlyRate.toInt()}/hr \u00b7 ${durationHours.toInt()}h',
), style: UiTypography.footnote2r.textSecondary,
),
], ],
), ),
], ],