chat update
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user