backup. before shop update
This commit is contained in:
34
lib/models/position.dart
Normal file
34
lib/models/position.dart
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
class Position {
|
||||
final double latitude;
|
||||
final double longitude;
|
||||
|
||||
Position({this.latitude, this.longitude});
|
||||
|
||||
@override
|
||||
bool operator ==(other) {
|
||||
var areEqual = other is Position &&
|
||||
other.latitude == latitude &&
|
||||
other.longitude == longitude;
|
||||
|
||||
return areEqual;
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => latitude.hashCode ^
|
||||
longitude.hashCode;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Lat $latitude, Lng $longitude';
|
||||
}
|
||||
|
||||
Position.fromJson(Map<String, dynamic> json) :
|
||||
latitude = double.parse(json['latitude'].toString()),
|
||||
longitude = double.parse(json['longitude'].toString());
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'latitude': latitude,
|
||||
'longitude': longitude
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user