getCurrentLocationAndSetState method
Implementation
Future<void> getCurrentLocationAndSetState(
Function(Position) setStateFunction) async {
try {
Position position = await getCurrentLocation();
setStateFunction(position);
} catch (e) {
print("Error getting location: $e");
}
}