fix fromJson for CustomerCountry

This commit is contained in:
Anthony 2021-02-24 19:34:42 +00:00
parent acffaada17
commit b935c2a29d

View File

@ -26,9 +26,18 @@ class CustomerCountry {
}
CustomerCountry.fromJson(Map<String, dynamic> json) {
countryCode = json['country_code'];
name = json['name'];
state = DefaultShippingState.fromJson(json['state']);
if (json == null) {
return;
}
if (json['country_code'] != null) {
countryCode = json['country_code'];
}
if (json['name'] != null) {
name = json['name'];
}
if (json['state'] != null) {
state = DefaultShippingState.fromJson(json['state']);
}
}
bool hasState() {