Thank you so much brother, but kindly tell me I am always getting the same city from this api "geolocation-db.com/json/",
Am I doing this right in the following code. When I tap the city Karachi is showing and this error also "Error: Expected a value of type 'GeolocationPosition', but got one of type 'Geoposition'"
This means the type expected should be Geoposition instead of GeoLocationPosition. Play with console log of javascript to first manipulate the Geoposition object
Your answer was not helpfull. The error says expected a value of type GeoLocationPosition and you are saying expected type should be geoposition. Please give me some code example, I am also not so good with javascript to paly with console.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you so much brother, but kindly tell me I am always getting the same city from this api "geolocation-db.com/json/",
Am I doing this right in the following code. When I tap the city Karachi is showing and this error also "Error: Expected a value of type 'GeolocationPosition', but got one of type 'Geoposition'"
success(pos) {
try {
_latitude = pos.coords.latitude;
_longitude = pos.coords.longitude;
} catch (ex) {
print("Exception thrown : " + ex.toString());
}
}
InkWell(
onTap: () async {
final _val = await LocationAPI().fetchData();
setState(() => _city = _val);
getCurrentPosition(allowInterop((pos) => success(pos)));
},
child: const Icon(
Icons.my_location,
size: 13.0,
),
),
This means the type expected should be Geoposition instead of GeoLocationPosition. Play with console log of javascript to first manipulate the Geoposition object
Your answer was not helpfull. The error says expected a value of type GeoLocationPosition and you are saying expected type should be geoposition. Please give me some code example, I am also not so good with javascript to paly with console.