Question

How to Get Device Lat Long in Flutter

Posted October 12, 2020 84 views
Flutter

I need Device current latitude and longitude in flutter how to get it ?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

Hello,

Refer to below link, which provides some insights about Flutter:

https://www.digitalocean.com/community/tutorials/flutter-geolocator-plugin
https://stackoverflow.com/questions/54926496/how-to-get-current-location-on-flutter-sdk-1-2-1

Below would fetch that information:

if (currentPosition != null)
Text(
“LAT: ${
currentPosition.latitude}, LNG: ${_currentPosition.longitude}”),
FlatButton(
child: Text(“Get location”),
onPressed: () {
_getCurrentLocation();

Hope this helps!

Cheers,
Sri Charan

by Paul Halliday
A simple guide on how to use the Geolocator plugin in Flutter to get the current latitude and longitude coordinates, and even get a placemark address.
Submit an Answer