init
This commit is contained in:
commit
e833bcaec4
224 files changed
+11812
No files matched your search
@@ -0,0 +1,59 @@
|
||||
class Address {
|
||||
final int id;
|
||||
final String country;
|
||||
final String postalCode;
|
||||
final String county;
|
||||
final String province;
|
||||
final String city;
|
||||
final String street;
|
||||
final String houseNumber;
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
final bool active;
|
||||
|
||||
Address({
|
||||
required this.id,
|
||||
required this.country,
|
||||
required this.postalCode,
|
||||
required this.county,
|
||||
required this.province,
|
||||
required this.city,
|
||||
required this.street,
|
||||
required this.houseNumber,
|
||||
required this.latitude,
|
||||
required this.longitude,
|
||||
required this.active,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'country': country,
|
||||
'postalCode': postalCode,
|
||||
'county': county,
|
||||
'province': province,
|
||||
'city': city,
|
||||
'street': street,
|
||||
'houseNumber': houseNumber,
|
||||
'latitude': latitude,
|
||||
'longitude': longitude,
|
||||
'active': active,
|
||||
};
|
||||
}
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) {
|
||||
return Address(
|
||||
id: json['id'] as int,
|
||||
country: json['country'] as String,
|
||||
postalCode: json['postalCode'] as String,
|
||||
county: json['county'] as String,
|
||||
province: json['province'] as String,
|
||||
city: json['city'] as String,
|
||||
street: json['street'] as String,
|
||||
houseNumber: json['houseNumber'] as String,
|
||||
latitude: (json['latitude'] as num).toDouble(),
|
||||
longitude: (json['longitude'] as num).toDouble(),
|
||||
active: json['active'] as bool,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user