import 'dart:ffi'; enum Entity { gathering, siteSeen, boating, diving } class CheckPoint{ int? id; double? lat; double? long; Entity? entitty; String? image1; String? image2; String? image3; String? image4; String? title; CheckPoint.fromId(int id) { // TODO: implement this.id = id; } CheckPoint({this.id, this.lat, this.long, this.entitty, this.image1, this.image2, this.image3, this.image4, this.title}); factory CheckPoint.fromMap(Map json) => CheckPoint( id: json['id'], lat: json['lat'], long: json['long'], entitty: json['entity'], image1: json['image1'], image2: json['image2'], image3: json['image3'], image4: json['image4'], title: json['note'], ); Map toMap() { return { 'id': id, 'lat': lat, 'long': long, 'entity': entitty, 'image1': image1, 'image2': image2, 'image3': image3, 'image4': image4, 'note': title, }; } Map toFeatureMap() { return { "type": "Feature", "geometry": { "type": "Point", "coordinates": [ long, lat ] }, "properties": { 'entity': entitty.toString(), 'image1': image1, 'image2': image2, 'image3': image3, 'image4': image4, 'note': title, } }; } }