initial rod app

This commit is contained in:
Mohamed Nouffer
2022-03-14 12:28:57 +05:30
commit 332a14230e
111 changed files with 4091 additions and 0 deletions

View File

@ -0,0 +1,31 @@
import 'package:geojson/geojson.dart';
import 'package:get/get.dart';
import 'package:rogapp/services/location_service.dart';
class HomeController extends GetxController {
List<GeoJsonFeatureCollection> locations = <GeoJsonFeatureCollection>[].obs;
@override
void onInit() {
super.onInit();
LocationService.loadLocations().then((value){
locations.add(value!);
});
}
GeoJsonFeature? getFeatureForLatLong(double lat, double long){
if(locations.length > 0){
for(GeoJsonFeature i in locations[0].collection){
GeoJsonMultiPoint p = i.geometry as GeoJsonMultiPoint;
if(p.geoSerie!.geoPoints[0].latitude == lat && p.geoSerie!.geoPoints[0].longitude == long){
return i;
}
}
}
}
}