toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    if (id != null) 'id': id,
    if (address != null) 'address': address,
    if (address1 != null) 'address1': address1,
    if (address2 != null) 'address2': address2,
    if (completeAddress != null) 'complete_address': completeAddress,
    if (city != null) 'city': city,
    if (state != null) 'state': state,
    if (country != null) 'country': country,
    if (postcode != null) 'postcode': postcode,
    if (latitude != null) 'latitude': latitude,
    if (longitude != null) 'longitude': longitude,
    if (placeId != null) 'place_id': placeId,
    if (userId != null) 'user_id': userId,
    if (createdAt != null) 'created_at': createdAt?.toIso8601String(),
    if (updatedAt != null) 'updated_at': updatedAt?.toIso8601String(),
  };
}