22 lines
582 B
Dart
22 lines
582 B
Dart
class AddressRecord {
|
|
const AddressRecord({
|
|
required this.id,
|
|
required this.houseNumber,
|
|
required this.colonia,
|
|
required this.street,
|
|
});
|
|
|
|
final int id;
|
|
final String houseNumber;
|
|
final String colonia;
|
|
final String street;
|
|
|
|
factory AddressRecord.fromJson(Map<String, dynamic> json) {
|
|
return AddressRecord(
|
|
id: (json['id'] as num).toInt(),
|
|
houseNumber: json['house_number']?.toString() ?? json['houseNumber']?.toString() ?? '',
|
|
colonia: json['colonia']?.toString() ?? '',
|
|
street: json['street']?.toString() ?? '',
|
|
);
|
|
}
|
|
} |