flutter-geolocator icon indicating copy to clipboard operation
flutter-geolocator copied to clipboard

Unable to get latitude and longitude

Open wahyu-handayani opened this issue 3 years ago • 0 comments

Hi I am using ios simulator 15.5 and running this code:

Position posisiNow = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);

when I try to print posisiNow.latitude, I always get NoSuchMethodError: The getter 'latitude' was called on null. while... when I print: print(posisiNow) I get Latitude: 37.33233141, Longitude: -122.0312186. That's only happen in ios simulator, when I try it in android it works fine. I have tried to get latitude and longitude by using _geolocatorPlatform.getPositionStream() and get the same result.. I get null when printingposisiNow.latitude but getting Latitude: 37.33233141, Longitude: -122.0312186 when only print posisiNow

wahyu-handayani avatar Sep 22 '22 04:09 wahyu-handayani