toJson method

  1. @override
Map<String, dynamic> toJson()
override

Converts the BaseDTO to a JSON object.

This method can be used when making HTTP requests to convert the DTO to a format that can be sent in the request.

Implementation

@override
Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = super.toJson();
  data['country'] = country;
  data['state'] = state;
  data['city'] = city;
  data['district'] = district;
  data['neighborhood'] = neighborhood;
  data['street'] = street;
  data['buildingNo'] = buildingNo;
  data['doorNo'] = doorNo;
  data['zipCode'] = zipCode;
  data['latitude'] = latitude;
  data['longitude'] = longitude;
  data['openAddress'] = openAddress;
  return data;
}