Fix build errors: localization syntax, key paths, and ViewOrderCard widget
This commit is contained in:
@@ -89,8 +89,8 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
final DateTime tomorrow = today.add(const Duration(days: 1));
|
||||
final DateTime checkDate = DateTime(date.year, date.month, date.day);
|
||||
|
||||
if (checkDate == today) return 'Today';
|
||||
if (checkDate == tomorrow) return 'Tomorrow';
|
||||
if (checkDate == today) return t.client_view_orders.card.today;
|
||||
if (checkDate == tomorrow) return t.client_view_orders.card.tomorrow;
|
||||
return DateFormat('EEE, MMM d').format(date);
|
||||
} catch (_) {
|
||||
return dateStr;
|
||||
@@ -279,19 +279,19 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
_buildStatItem(
|
||||
icon: UiIcons.dollar,
|
||||
value: '\$${cost.round()}',
|
||||
label: 'Total',
|
||||
label: t.client_view_orders.card.total,
|
||||
),
|
||||
_buildStatDivider(),
|
||||
_buildStatItem(
|
||||
icon: UiIcons.clock,
|
||||
value: hours.toStringAsFixed(1),
|
||||
label: 'Hrs',
|
||||
label: t.client_view_orders.card.hrs,
|
||||
),
|
||||
_buildStatDivider(),
|
||||
_buildStatItem(
|
||||
icon: UiIcons.users,
|
||||
value: '${order.workersNeeded}',
|
||||
label: 'Workers',
|
||||
label: t.client_create_order.one_time.workers_label,
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -303,14 +303,14 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
children: <Widget>[
|
||||
Expanded(
|
||||
child: _buildTimeDisplay(
|
||||
label: 'Clock In',
|
||||
label: t.client_view_orders.card.clock_in,
|
||||
time: _formatTime(timeStr: order.startTime),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: UiConstants.space3),
|
||||
Expanded(
|
||||
child: _buildTimeDisplay(
|
||||
label: 'Clock Out',
|
||||
label: t.client_view_orders.card.clock_out,
|
||||
time: _formatTime(timeStr: order.endTime),
|
||||
),
|
||||
),
|
||||
@@ -341,8 +341,8 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
const SizedBox(width: UiConstants.space2),
|
||||
Text(
|
||||
coveragePercent == 100
|
||||
? 'All Workers Confirmed'
|
||||
: '${order.workersNeeded} Workers Needed',
|
||||
? t.client_view_orders.card.all_confirmed
|
||||
: t.client_view_orders.card.workers_needed(count: order.workersNeeded),
|
||||
style: UiTypography.body2m.textPrimary,
|
||||
),
|
||||
],
|
||||
@@ -378,7 +378,7 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 12),
|
||||
child: Text(
|
||||
'+${order.confirmedApps.length - 3} more',
|
||||
t.client_view_orders.card.show_more_workers(count: order.confirmedApps.length - 3),
|
||||
style: UiTypography.footnote2r.textSecondary,
|
||||
),
|
||||
),
|
||||
@@ -408,13 +408,13 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
'CONFIRMED WORKERS',
|
||||
t.client_view_orders.card.confirmed_workers_title,
|
||||
style: UiTypography.footnote2b.textSecondary,
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {},
|
||||
child: Text(
|
||||
'Message All',
|
||||
t.client_view_orders.card.message_all,
|
||||
style: UiTypography.footnote2b.copyWith(
|
||||
color: UiColors.primary,
|
||||
),
|
||||
@@ -433,7 +433,7 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
child: TextButton(
|
||||
onPressed: () {},
|
||||
child: Text(
|
||||
'Show ${order.confirmedApps.length - 5} more workers',
|
||||
t.client_view_orders.card.show_more_workers(count: order.confirmedApps.length - 5),
|
||||
style: UiTypography.body2m.copyWith(
|
||||
color: UiColors.primary,
|
||||
),
|
||||
@@ -569,7 +569,7 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
borderRadius: UiConstants.radiusSm,
|
||||
),
|
||||
child: Text(
|
||||
'Checked In',
|
||||
t.client_view_orders.card.checked_in,
|
||||
style: UiTypography.titleUppercase4m.copyWith(
|
||||
color: UiColors.textSuccess,
|
||||
),
|
||||
@@ -615,16 +615,16 @@ class _ViewOrderCardState extends State<ViewOrderCard> {
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: const Text('Call'),
|
||||
content: Text('Do you want to call $phone?'),
|
||||
title: Text(t.client_view_orders.card.call_dialog.title),
|
||||
content: Text(t.client_view_orders.card.call_dialog.message(phone: phone)),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(false),
|
||||
child: const Text('Cancel'),
|
||||
child: Text(t.common.cancel),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(true),
|
||||
child: const Text('Call'),
|
||||
child: Text(t.client_view_orders.card.call_dialog.title),
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user