Fix build errors: localization syntax, key paths, and ViewOrderCard widget
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'package:core_localization/core_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_modular/flutter_modular.dart';
|
||||
|
||||
@@ -58,9 +59,9 @@ class _ShiftCardState extends State<ShiftCard> {
|
||||
try {
|
||||
final date = DateTime.parse(dateStr);
|
||||
final diff = DateTime.now().difference(date);
|
||||
if (diff.inHours < 1) return 'Just now';
|
||||
if (diff.inHours < 24) return 'Pending ${diff.inHours}h ago';
|
||||
return 'Pending ${diff.inDays}d ago';
|
||||
if (diff.inHours < 1) return t.staff_shifts.card.just_now;
|
||||
if (diff.inHours < 24) return t.staff_shifts.details.pending_time(time: '${diff.inHours}h');
|
||||
return t.staff_shifts.details.pending_time(time: '${diff.inDays}d');
|
||||
} catch (e) {
|
||||
return '';
|
||||
}
|
||||
@@ -220,7 +221,11 @@ class _ShiftCardState extends State<ShiftCard> {
|
||||
borderRadius: UiConstants.radiusFull,
|
||||
),
|
||||
child: Text(
|
||||
'Assigned ${_getTimeAgo(widget.shift.createdDate).replaceAll('Pending ', '')}',
|
||||
t.staff_shifts.card.assigned(
|
||||
time: _getTimeAgo(widget.shift.createdDate)
|
||||
.replaceAll('Pending ', '')
|
||||
.replaceAll('Just now', 'just now'),
|
||||
),
|
||||
style: UiTypography.body3m.white,
|
||||
),
|
||||
),
|
||||
@@ -302,13 +307,13 @@ class _ShiftCardState extends State<ShiftCard> {
|
||||
children: [
|
||||
_buildTag(
|
||||
UiIcons.zap,
|
||||
'Immediate start',
|
||||
t.staff_shifts.tags.immediate_start,
|
||||
UiColors.accent.withValues(alpha: 0.3),
|
||||
UiColors.foreground,
|
||||
),
|
||||
_buildTag(
|
||||
UiIcons.timer,
|
||||
'No experience',
|
||||
t.staff_shifts.tags.no_experience,
|
||||
UiColors.tagError,
|
||||
UiColors.textError,
|
||||
),
|
||||
@@ -342,7 +347,7 @@ class _ShiftCardState extends State<ShiftCard> {
|
||||
BorderRadius.circular(UiConstants.radiusBase),
|
||||
),
|
||||
),
|
||||
child: const Text('Accept shift'),
|
||||
child: Text(t.staff_shifts.card.accept_shift),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: UiConstants.space2),
|
||||
@@ -361,7 +366,7 @@ class _ShiftCardState extends State<ShiftCard> {
|
||||
BorderRadius.circular(UiConstants.radiusBase),
|
||||
),
|
||||
),
|
||||
child: const Text('Decline shift'),
|
||||
child: Text(t.staff_shifts.card.decline_shift),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: UiConstants.space5),
|
||||
|
||||
Reference in New Issue
Block a user