fix fromJson for CustomerCountry
This commit is contained in:
parent
acffaada17
commit
b935c2a29d
@ -26,10 +26,19 @@ class CustomerCountry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
CustomerCountry.fromJson(Map<String, dynamic> json) {
|
CustomerCountry.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (json['country_code'] != null) {
|
||||||
countryCode = json['country_code'];
|
countryCode = json['country_code'];
|
||||||
|
}
|
||||||
|
if (json['name'] != null) {
|
||||||
name = json['name'];
|
name = json['name'];
|
||||||
|
}
|
||||||
|
if (json['state'] != null) {
|
||||||
state = DefaultShippingState.fromJson(json['state']);
|
state = DefaultShippingState.fromJson(json['state']);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool hasState() {
|
bool hasState() {
|
||||||
return this.state != null && this.state.name != null ? true : false;
|
return this.state != null && this.state.name != null ? true : false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user