Is it possible to share your location through flutter app

3,551

I have figured out that the only way to be able to share your location via a flutter app is to add the coordinates to a url string of google maps

i.e.

_share(){
    Share.share('https://www.google.com/maps/search/?api=1&query=${_currentLocation.latitude},${_currentLocation.longitude}');
  }
Share:
3,551
Xander van Zyl
Author by

Xander van Zyl

Updated on December 12, 2022

Comments

  • Xander van Zyl
    Xander van Zyl over 1 year

    I built an app in flutter, dart to access the location of the user. I now want to share the current physical location of the user via Whatsapp, email etc but not as coordinates.

    I have tried geolocation as well as location but seem to only manage to get the coordinates. Below is a snippet of my share button that shows me the coordinates.

    _share(){ Share.share('I have arrived safely at ${_currentLocation.latitude} & ${_currentLocation.longitude}'); }

    I am expecting to see a message that can be shared to anyone on my device that provides my current location. I am not receiving any error messages as i am currently only getting the coordinates as shown in the code. What can be done to share the physical location of my device?