Fix build errors: localization syntax, key paths, and ViewOrderCard widget

This commit is contained in:
2026-02-14 16:26:10 +05:30
parent 097481d26a
commit 4e1a41ebff
25 changed files with 420 additions and 207 deletions

View File

@@ -227,23 +227,23 @@ class ClientHubsPage extends StatelessWidget {
}
Future<void> _confirmDeleteHub(BuildContext context, Hub hub) async {
final String hubName = hub.name.isEmpty ? 'this hub' : hub.name;
final String hubName = hub.name.isEmpty ? t.client_hubs.title : hub.name;
return showDialog<void>(
context: context,
barrierDismissible: false,
builder: (BuildContext dialogContext) {
return AlertDialog(
title: const Text('Confirm Hub Deletion'),
title: Text(t.client_hubs.delete_dialog.title),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text('Are you sure you want to delete "$hubName"?'),
Text(t.client_hubs.delete_dialog.message(hubName: hubName)),
const SizedBox(height: UiConstants.space2),
const Text('This action cannot be undone.'),
Text(t.client_hubs.delete_dialog.undo_warning),
const SizedBox(height: UiConstants.space2),
Text(
'Note that if there are any shifts/orders assigned to this hub we shouldn\'t be able to delete the hub.',
t.client_hubs.delete_dialog.dependency_warning,
style: UiTypography.footnote1r.copyWith(
color: UiColors.textSecondary,
),
@@ -253,7 +253,7 @@ class ClientHubsPage extends StatelessWidget {
actions: <Widget>[
TextButton(
onPressed: () => Modular.to.pop(),
child: const Text('Cancel'),
child: Text(t.client_hubs.delete_dialog.cancel),
),
TextButton(
onPressed: () {
@@ -265,7 +265,7 @@ class ClientHubsPage extends StatelessWidget {
style: TextButton.styleFrom(
foregroundColor: UiColors.destructive,
),
child: const Text('Delete'),
child: Text(t.client_hubs.delete_dialog.delete),
),
],
);