49 lines
1.1 KiB
Dart
49 lines
1.1 KiB
Dart
|
class MyLocation {
|
||
|
final String street;
|
||
|
final String country;
|
||
|
|
||
|
/// DE: Bundesland
|
||
|
final String? administrativeArea;
|
||
|
/// City
|
||
|
final String locality;
|
||
|
/// DE: Stadtteil
|
||
|
final String? subLocality;
|
||
|
final String? postalCode;
|
||
|
final double? latitude;
|
||
|
final double? longitude;
|
||
|
|
||
|
MyLocation({
|
||
|
required this.street,
|
||
|
required this.country,
|
||
|
required this.administrativeArea,
|
||
|
required this.locality,
|
||
|
required this.subLocality,
|
||
|
required this.postalCode,
|
||
|
required this.latitude,
|
||
|
required this.longitude,
|
||
|
});
|
||
|
|
||
|
// convert to a map
|
||
|
Map<String, dynamic> toMap() {
|
||
|
return {
|
||
|
'street': street,
|
||
|
'country': country,
|
||
|
'administrativeArea': administrativeArea,
|
||
|
'locality': locality,
|
||
|
'subLocality': subLocality,
|
||
|
'postalCode': postalCode,
|
||
|
'latitude': latitude,
|
||
|
'longitude': longitude,
|
||
|
};
|
||
|
}
|
||
|
|
||
|
@override
|
||
|
int get hashCode => Object.hash(latitude, longitude);
|
||
|
|
||
|
@override
|
||
|
bool operator ==(Object other) =>
|
||
|
other is MyLocation &&
|
||
|
latitude == other.latitude &&
|
||
|
longitude == other.longitude;
|
||
|
}
|