fromJson static method

Address? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static Address? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return Address(
    countryCode: (json['country_code'] as String?) ?? '',
    state: (json['state'] as String?) ?? '',
    city: (json['city'] as String?) ?? '',
    streetLine1: (json['street_line1'] as String?) ?? '',
    streetLine2: (json['street_line2'] as String?) ?? '',
    postalCode: (json['postal_code'] as String?) ?? '',
  );
}