Closed Priya-Manoharan closed 2 months ago
Future getCountry() async { emit(LocationLoading()); try { await getLocation(); if (position != null) { List placemarks = await placemarkFromCoordinates(position!.latitude, position!.longitude); print("placemarks $placemarks"); place = placemarks[0]; emit(LocationSuccess()); } else { emit(LocationFail('Failed to get the position.')); } } catch (e) { emit(LocationFail(e.toString())); } }
getting null value in the placemarkFromCoordinates function
geocoding: ^3.0.0
Please check the following before submitting a new issue.
Please select for which platform(s) you need help
Your question
Future getCountry() async {
emit(LocationLoading());
try {
await getLocation();
if (position != null) {
List placemarks = await placemarkFromCoordinates(position!.latitude, position!.longitude);
print("placemarks $placemarks");
place = placemarks[0];
emit(LocationSuccess());
} else {
emit(LocationFail('Failed to get the position.'));
}
} catch (e) {
emit(LocationFail(e.toString()));
}
}
getting null value in the placemarkFromCoordinates function
Version
geocoding: ^3.0.0