feat: Add orderId and normalized orderType to the Shift model to enable UI grouping and type-badging in shift displays.
This commit is contained in:
@@ -185,12 +185,15 @@ class _MyShiftCardState extends State<MyShiftCard> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Status Badge
|
||||
if (statusText.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: UiConstants.space2),
|
||||
child: Row(
|
||||
children: [
|
||||
// Badge row: shows the status label and the shift-type chip.
|
||||
// The type chip (One Day / Multi-Day / Long Term) is always
|
||||
// rendered when orderType is present — even for "open" find-shifts
|
||||
// cards that may have no meaningful status text.
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: UiConstants.space2),
|
||||
child: Row(
|
||||
children: [
|
||||
if (statusText.isNotEmpty) ...[
|
||||
if (statusIcon != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(
|
||||
@@ -221,30 +224,31 @@ class _MyShiftCardState extends State<MyShiftCard> {
|
||||
letterSpacing: 0.5,
|
||||
),
|
||||
),
|
||||
// Shift Type Badge (Order type)
|
||||
if ((widget.shift.orderType ?? '').isNotEmpty) ...[
|
||||
const SizedBox(width: UiConstants.space2),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: UiConstants.space2,
|
||||
vertical: 2,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: UiColors.background,
|
||||
borderRadius: UiConstants.radiusSm,
|
||||
border: Border.all(color: UiColors.border),
|
||||
),
|
||||
child: Text(
|
||||
_getShiftType(),
|
||||
style: UiTypography.footnote2m.copyWith(
|
||||
color: UiColors.textSecondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(width: UiConstants.space2),
|
||||
],
|
||||
),
|
||||
// Type badge — driven by RECURRING / PERMANENT / one-day
|
||||
// order data and always visible so users can filter
|
||||
// Find Shifts cards at a glance.
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: UiConstants.space2,
|
||||
vertical: 2,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: UiColors.background,
|
||||
borderRadius: UiConstants.radiusSm,
|
||||
border: Border.all(color: UiColors.border),
|
||||
),
|
||||
child: Text(
|
||||
_getShiftType(),
|
||||
style: UiTypography.footnote2m.copyWith(
|
||||
color: UiColors.textSecondary,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -85,11 +85,13 @@ class _FindShiftsTabState extends State<FindShiftsTab> {
|
||||
|
||||
final Shift first = group.first;
|
||||
final List<ShiftSchedule> schedules = group
|
||||
.map((s) => ShiftSchedule(
|
||||
date: s.date,
|
||||
startTime: s.startTime,
|
||||
endTime: s.endTime,
|
||||
))
|
||||
.map(
|
||||
(s) => ShiftSchedule(
|
||||
date: s.date,
|
||||
startTime: s.startTime,
|
||||
endTime: s.endTime,
|
||||
),
|
||||
)
|
||||
.toList();
|
||||
|
||||
result.add(
|
||||
|
||||
Reference in New Issue
Block a user