是否可以通过 flutter app 共享您的位置

Is it possible to share your location through flutter app

我用 flutter、dart 构建了一个应用程序来访问用户的位置。我现在想通过 Whatsapp、电子邮件等分享用户的当前物理位置,但不是坐标。

我已经尝试了地理定位和位置,但似乎只能设法获得坐标。下面是我的分享按钮的片段,显示了坐标。

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

我期待看到一条消息,该消息可以与我设备上的任何人共享,提供我的当前位置。我没有收到任何错误消息,因为我目前只获得代码中显示的坐标。如何共享我的设备的物理位置?

我发现能够通过 flutter 应用程序共享您的位置的唯一方法是将坐标添加到 google 地图

的 url 字符串中

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