【问题标题】:Is it possible to share your location through flutter app是否可以通过颤振应用分享您的位置
【发布时间】:2019-07-24 15:07:45
【问题描述】:

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

我已经尝试过地理定位和位置,但似乎只能获得坐标。下面是我的分享按钮的 sn-p,它显示了坐标。

_share(){ Share.share('我已经安全到达${_currentLocation.latitude} & ${_currentLocation.longitude}'); }

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

【问题讨论】:

    标签: flutter dart geolocation location sharing


    【解决方案1】:

    我发现能够通过颤振应用分享您的位置的唯一方法是将坐标添加到谷歌地图的 url 字符串

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

    【讨论】:

      猜你喜欢
      • 2020-07-10
      • 1970-01-01
      • 2021-04-21
      • 1970-01-01
      • 2022-01-22
      • 2012-10-18
      • 2020-09-20
      • 1970-01-01
      • 2020-12-04
      相关资源
      最近更新 更多