Untitled
unknown
plain_text
2 years ago
737 B
4
Indexable
import 'dart:core'; class PointOfInterest { final int poiId; String name; double latitude; double longitude; // Set<Student> likedByStudents = new HashSet<Student>(); PointOfInterest({ required this.poiId, required this.name, required this.latitude, required this.longitude }); factory PointOfInterest.fromJson(Map poiMap){ return PointOfInterest( poiId:poiMap ['poiID'], name: poiMap['name'], latitude: (poiMap['latitude'] as num).toDouble(), longitude: (poiMap['longitude'] as num).toDouble(), ); } Map toJson() =>{ "poiID" : poiId, 'name' : name, 'latitude' : latitude, "longitude" : longitude, }; }
Editor is loading...
Leave a Comment