chat update

This commit is contained in:
Abhishek Mali
2026-02-27 10:12:51 +05:30
parent 0c1d3b8cb2
commit 98d184d901
7 changed files with 237 additions and 150 deletions

View File

@@ -248,7 +248,7 @@ class _OrdersScreenState extends State<OrdersScreen> {
borderRadius: BorderRadius.circular(12),
),
child: Text(
isDomestic ? "Domestic\nDistribution" : (status ?? "Unknown"),
isDomestic ? "Domestic\nDistribution" : formatStatusLabel(status),
textAlign: TextAlign.center,
maxLines: isDomestic ? 2 : 1,
style: TextStyle(
@@ -366,3 +366,24 @@ class _StatusConfig {
final Color bg;
_StatusConfig(this.fg, this.bg);
}
// ================= STATUS LABEL MAP =================
const Map<String, String> statusLabelMap = {
'shipment_ready': 'Shipment Ready',
'export_custom': 'Export Custom',
'international_transit': 'International Transit',
'arrived_at_port': 'Arrived At Port',
'import_custom': 'Import Custom',
'warehouse': 'Warehouse Processing',
'domestic_distribution': 'Domestic Distribution',
'out_for_delivery': 'Out For Delivery',
'delivered': 'Delivered',
};
String formatStatusLabel(String? status) {
if (status == null || status.isEmpty) return "Unknown";
return statusLabelMap[status.toLowerCase()] ??
status.replaceAll('_', ' ').toUpperCase();
}