0
    var position = await Geolocator().getCurrentPosition(
      desiredAccuracy: LocationAccuracy.best,
    );
    setState(() {
      currentposition = position;
      print(currentposition);
      locationdata();
    }),}

I wanted to find and use my location using geolocator. So as to check if my location is right, I used print. Surprisingly, the lat and long that I get are not from my place. They are of google building in USA. How to solve this problem?

Helix xxx
  • 41
  • 4

1 Answers1

0

You need to use Real/Physical device for that. It will pick default location of USA as you are running it in emulator.

You can emulate the location see here: How to emulate GPS location in the Android Emulator?

Hamza
  • 1,523
  • 15
  • 33