feat: Add event name to order items and refactor navigation and shift data access to use direct object properties.

This commit is contained in:
Achintha Isuru
2026-02-22 21:07:57 -05:00
parent 0980c6584b
commit 9e38fb7d5f
8 changed files with 150 additions and 93 deletions

View File

@@ -149,6 +149,7 @@ class _ShiftDetailsPageState extends State<ShiftDetailsPage> {
const Divider(height: 1, thickness: 0.5),
ShiftDateTimeSection(
date: displayShift.date,
endDate: displayShift.endDate,
startTime: displayShift.startTime,
endTime: displayShift.endTime,
shiftDateLabel: i18n.shift_date,

View File

@@ -172,13 +172,6 @@ class _MyShiftCardState extends State<MyShiftCard> {
color: UiColors.white,
borderRadius: UiConstants.radiusLg,
border: Border.all(color: UiColors.border),
boxShadow: [
BoxShadow(
color: UiColors.black.withValues(alpha: 0.05),
blurRadius: 2,
offset: const Offset(0, 1),
),
],
),
child: Padding(
padding: const EdgeInsets.all(UiConstants.space4),

View File

@@ -7,6 +7,9 @@ class ShiftDateTimeSection extends StatelessWidget {
/// The ISO string of the date.
final String date;
/// The end date string (ISO).
final String? endDate;
/// The start time string (HH:mm).
final String startTime;
@@ -26,6 +29,7 @@ class ShiftDateTimeSection extends StatelessWidget {
const ShiftDateTimeSection({
super.key,
required this.date,
required this.endDate,
required this.startTime,
required this.endTime,
required this.shiftDateLabel,
@@ -63,21 +67,57 @@ class ShiftDateTimeSection extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
shiftDateLabel,
style: UiTypography.titleUppercase4b.textSecondary,
),
const SizedBox(height: UiConstants.space2),
Row(
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Icon(UiIcons.calendar, size: 20, color: UiColors.primary),
const SizedBox(width: UiConstants.space2),
Text(
_formatDate(date),
style: UiTypography.headline5m.textPrimary,
shiftDateLabel,
style: UiTypography.titleUppercase4b.textSecondary,
),
const SizedBox(height: UiConstants.space2),
Row(
children: [
const Icon(
UiIcons.calendar,
size: 20,
color: UiColors.primary,
),
const SizedBox(width: UiConstants.space2),
Text(
_formatDate(date),
style: UiTypography.headline5m.textPrimary,
),
],
),
],
),
if (endDate != null) ...[
const SizedBox(height: UiConstants.space4),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
shiftDateLabel,
style: UiTypography.titleUppercase4b.textSecondary,
),
const SizedBox(height: UiConstants.space2),
Row(
children: [
const Icon(
UiIcons.calendar,
size: 20,
color: UiColors.primary,
),
const SizedBox(width: UiConstants.space2),
Text(
_formatDate(endDate!),
style: UiTypography.headline5m.textPrimary,
),
],
),
],
),
],
const SizedBox(height: UiConstants.space4),
Row(
children: [