feat: Display order event name with a new calendar check icon and update associated styles in the order card.
This commit is contained in:
@@ -28,6 +28,9 @@ class UiIcons {
|
||||
/// Calendar icon for shifts or schedules
|
||||
static const IconData calendar = _IconLib.calendar;
|
||||
|
||||
/// Calender check icon for shifts or schedules
|
||||
static const IconData calendarCheck = _IconLib.calendarCheck;
|
||||
|
||||
/// Briefcase icon for jobs
|
||||
static const IconData briefcase = _IconLib.briefcase;
|
||||
|
||||
|
||||
@@ -34,7 +34,8 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
backgroundColor: UiColors.transparent,
|
||||
builder: (BuildContext context) => OrderEditSheet(
|
||||
order: order,
|
||||
onUpdated: () => this.context.read<ViewOrdersCubit>().updateWeekOffset(0),
|
||||
onUpdated: () =>
|
||||
this.context.read<ViewOrdersCubit>().updateWeekOffset(0),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -171,7 +172,9 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: UiConstants.space1 + 2),
|
||||
const SizedBox(
|
||||
width: UiConstants.space1 + 2,
|
||||
),
|
||||
Text(
|
||||
statusLabel.toUpperCase(),
|
||||
style: UiTypography.footnote2b.copyWith(
|
||||
@@ -202,20 +205,23 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
// Title
|
||||
Text(
|
||||
order.title,
|
||||
style: UiTypography.headline4m.textPrimary,
|
||||
style: UiTypography.headline3m.textPrimary,
|
||||
),
|
||||
const SizedBox(height: UiConstants.space1),
|
||||
// Client & Date
|
||||
Row(
|
||||
spacing: UiConstants.space1,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
order.clientName,
|
||||
style: UiTypography.body3r.textSecondary,
|
||||
const Icon(
|
||||
UiIcons.calendarCheck,
|
||||
size: 14,
|
||||
color: UiColors.iconSecondary,
|
||||
),
|
||||
Text(
|
||||
order.eventName,
|
||||
style: UiTypography.headline5m.textSecondary,
|
||||
),
|
||||
const SizedBox(width: 0),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: UiConstants.space2),
|
||||
const SizedBox(height: UiConstants.space4),
|
||||
// Location (Hub name + Address)
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -236,14 +242,17 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
if (order.location.isNotEmpty)
|
||||
Text(
|
||||
order.location,
|
||||
style: UiTypography.footnote1b.textPrimary,
|
||||
style:
|
||||
UiTypography.footnote1b.textPrimary,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
if (order.locationAddress.isNotEmpty)
|
||||
Text(
|
||||
order.locationAddress,
|
||||
style: UiTypography.footnote2r.textSecondary,
|
||||
style: UiTypography
|
||||
.footnote2r
|
||||
.textSecondary,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -273,8 +282,7 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
: UiIcons.chevronDown,
|
||||
color: UiColors.iconSecondary,
|
||||
bgColor: UiColors.bgSecondary,
|
||||
onTap: () =>
|
||||
setState(() => _expanded = !_expanded),
|
||||
onTap: () => setState(() => _expanded = !_expanded),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -340,22 +348,24 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
Row(
|
||||
children: <Widget>[
|
||||
if (coveragePercent != 100)
|
||||
const Icon(
|
||||
UiIcons.error,
|
||||
size: 16,
|
||||
color: UiColors.textError,
|
||||
),
|
||||
const Icon(
|
||||
UiIcons.error,
|
||||
size: 16,
|
||||
color: UiColors.textError,
|
||||
),
|
||||
if (coveragePercent == 100)
|
||||
const Icon(
|
||||
UiIcons.checkCircle,
|
||||
size: 16,
|
||||
color: UiColors.textSuccess,
|
||||
),
|
||||
const Icon(
|
||||
UiIcons.checkCircle,
|
||||
size: 16,
|
||||
color: UiColors.textSuccess,
|
||||
),
|
||||
const SizedBox(width: UiConstants.space2),
|
||||
Text(
|
||||
coveragePercent == 100
|
||||
? t.client_view_orders.card.all_confirmed
|
||||
: t.client_view_orders.card.workers_needed(count: order.workersNeeded),
|
||||
: t.client_view_orders.card.workers_needed(
|
||||
count: order.workersNeeded,
|
||||
),
|
||||
style: UiTypography.body2m.textPrimary,
|
||||
),
|
||||
],
|
||||
@@ -391,7 +401,9 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Text(
|
||||
t.client_view_orders.card.show_more_workers(count: order.confirmedApps.length - 3),
|
||||
t.client_view_orders.card.show_more_workers(
|
||||
count: order.confirmedApps.length - 3,
|
||||
),
|
||||
style: UiTypography.footnote2r.textSecondary,
|
||||
),
|
||||
),
|
||||
@@ -446,7 +458,9 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
t.client_view_orders.card.show_more_workers(count: order.confirmedApps.length - 5),
|
||||
t.client_view_orders.card.show_more_workers(
|
||||
count: order.confirmedApps.length - 5,
|
||||
),
|
||||
style: UiTypography.body2m.copyWith(
|
||||
color: UiColors.primary,
|
||||
),
|
||||
@@ -588,7 +602,8 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
),
|
||||
),
|
||||
),
|
||||
] else if ((app['status'] as String?)?.isNotEmpty ?? false) ...<Widget>[
|
||||
] else if ((app['status'] as String?)?.isNotEmpty ??
|
||||
false) ...<Widget>[
|
||||
const SizedBox(width: UiConstants.space2),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
@@ -629,7 +644,9 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(t.client_view_orders.card.call_dialog.title),
|
||||
content: Text(t.client_view_orders.card.call_dialog.message(phone: phone)),
|
||||
content: Text(
|
||||
t.client_view_orders.card.call_dialog.message(phone: phone),
|
||||
),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
@@ -716,4 +733,3 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user