Hi I'm trying to construct the below function and getting a conflict. I have imported as per recommendation import 'package:latlong2/latlong.dart' as latLong; Your assistance will be appreciated.
ERROR: The argument type 'List (where LatLng is defined in C:\DEVELOPMENT\flutter.pub-cache\hosted\pub.dartlang.org\latlong2-0.8.1\lib\latlong\LatLng.dart)' can't be assigned to the parameter type 'List (where LatLng is defined in C:\DEVELOPMENT\flutter.pub-cache\hosted\pub.dartlang.org\poly_geofence_service-1.6.0\lib\models\lat_lng.dart)'.
// Convert GeofenceData to PolyGeofence
_polyGeofenceList.clear();
PolyGeofence newGeofence;
for (var i=0; i<geofenceDataList.length; i++) {
newGeofence = PolyGeofence(
id: geofenceDataList[i].id,
data: geofenceDataList[i].data,
polygon: geofenceDataList[i].polygon,
);
_polyGeofenceList.add(newGeofence);
}
// Add new geofence data into service
_polyGeofenceService
..clearPolyGeofenceList()
..addPolyGeofenceList(_polyGeofenceList);
// UI update or etc.
Future<String> parseJsonFromAssets(String assetsPath) async {
return rootBundle.loadString(assetsPath);
}
Future<List<GeofenceData>> getGeofenceDataList() async {
String Json = await parseJsonFromAssets("assets/polygonlnglat.json");
return (json.decode(Json) as List)
.map((data) => GeofenceData.fromJson(data))
.toList();