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) { CustomerCountry.fromJson(Map<String, dynamic> json) {
countryCode = json['country_code']; if (json == null) {
name = json['name']; return;
state = DefaultShippingState.fromJson(json['state']); }
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() { bool hasState() {