first commit
This commit is contained in:
77
lib/models/check_points.dart
Normal file
77
lib/models/check_points.dart
Normal file
@ -0,0 +1,77 @@
|
||||
|
||||
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<String, dynamic> 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<String, dynamic> toMap() {
|
||||
return {
|
||||
'id': id,
|
||||
'lat': lat,
|
||||
'long': long,
|
||||
'entity': entitty,
|
||||
'image1': image1,
|
||||
'image2': image2,
|
||||
'image3': image3,
|
||||
'image4': image4,
|
||||
'note': title,
|
||||
};
|
||||
}
|
||||
|
||||
Map<String, dynamic> toFeatureMap() {
|
||||
return {
|
||||
"type": "Feature",
|
||||
"geometry": {
|
||||
"type": "Point",
|
||||
"coordinates": [
|
||||
long,
|
||||
lat
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
'entity': entitty.toString(),
|
||||
'image1': image1,
|
||||
'image2': image2,
|
||||
'image3': image3,
|
||||
'image4': image4,
|
||||
'note': title,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
27
lib/models/rog_event_model.dart
Normal file
27
lib/models/rog_event_model.dart
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
class RogEvent{
|
||||
int? id;
|
||||
String? title;
|
||||
String? venue;
|
||||
DateTime? at_date;
|
||||
List<LatLng>? latlngs;
|
||||
|
||||
RogEvent({this.id, this.title, this.venue, this.at_date, this.latlngs});
|
||||
|
||||
RogEvent.fromId(int id){
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
Future<void> fromgeoJson(String geojson) async {
|
||||
final geo = GeoJson();
|
||||
return await geo.parse(geojson, verbose: true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user