You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.3 KiB
55 lines
1.3 KiB
/// logisticCode : "" |
|
/// shipperCode : "" |
|
/// state : 0 |
|
/// success : true |
|
/// traces : [{"acceptStation":"","acceptTime":""}] |
|
|
|
class Logistics { |
|
String logisticCode; |
|
String shipperCode; |
|
int state; |
|
bool success; |
|
List<TracesBean> traces; |
|
|
|
static Logistics fromJson(Map<String, dynamic> map) { |
|
if (map == null) return null; |
|
Logistics logisticsBean = Logistics(); |
|
logisticsBean.logisticCode = map['logisticCode']; |
|
logisticsBean.shipperCode = map['shipperCode']; |
|
logisticsBean.state = map['state']; |
|
logisticsBean.success = map['success']; |
|
logisticsBean.traces = List()..addAll( |
|
(map['traces'] as List ?? []).map((o) => TracesBean.fromMap(o)) |
|
); |
|
return logisticsBean; |
|
} |
|
|
|
Map toJson() => { |
|
"logisticCode": logisticCode, |
|
"shipperCode": shipperCode, |
|
"state": state, |
|
"success": success, |
|
"traces": traces, |
|
}; |
|
} |
|
|
|
/// acceptStation : "" |
|
/// acceptTime : "" |
|
|
|
class TracesBean { |
|
String acceptStation; |
|
String acceptTime; |
|
|
|
static TracesBean fromMap(Map<String, dynamic> map) { |
|
if (map == null) return null; |
|
TracesBean tracesBean = TracesBean(); |
|
tracesBean.acceptStation = map['acceptStation']; |
|
tracesBean.acceptTime = map['acceptTime']; |
|
return tracesBean; |
|
} |
|
|
|
Map toJson() => { |
|
"acceptStation": acceptStation, |
|
"acceptTime": acceptTime, |
|
}; |
|
} |