import '../api/types.dart'; class DeliveryAddress implements Serializable { final int id; final String line1; final String line2; final String postalCode; final String city; final String subdivision; final String countryCode; final double? latitude; final double? longitude; final String formattedAddress; const DeliveryAddress({ required this.id, required this.line1, required this.line2, required this.postalCode, required this.city, required this.subdivision, required this.countryCode, this.latitude, this.longitude, required this.formattedAddress, }); factory DeliveryAddress.fromJson(Map json) { return DeliveryAddress( id: json['id'] as int, line1: json['line1'] as String, line2: json['line2'] as String, postalCode: json['postalCode'] as String, city: json['city'] as String, subdivision: json['subdivision'] as String, countryCode: json['countryCode'] as String, latitude: json['latitude'] as double?, longitude: json['longitude'] as double?, formattedAddress: json['formattedAddress'] as String, ); } @override Map toJson() => { 'id': id, 'line1': line1, 'line2': line2, 'postalCode': postalCode, 'city': city, 'subdivision': subdivision, 'countryCode': countryCode, 'latitude': latitude, 'longitude': longitude, 'formattedAddress': formattedAddress, }; }