toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (addressType != null) {
    json['address_type'] = addressType!.value;
  }
  if (addressLine != null) json['address_line'] = addressLine;
  if (buildingNumber != null) json['building_number'] = buildingNumber;
  if (buildingName != null) json['building_name'] = buildingName;
  if (floor != null) json['floor'] = floor;
  if (streetName != null) json['street_name'] = streetName;
  if (districtName != null) json['district_name'] = districtName;
  if (postBox != null) json['post_box'] = postBox;
  if (townName != null) json['town_name'] = townName;
  if (region != null) json['region'] = region;
  if (country != null) json['country'] = country;
  return json;
}