简体   繁体   English

Flutter - 获取当前用户位置

[英]Flutter - Get Current User Location

I saw that there are several methods to obtain the current user's location on flutter.我看到有几种方法可以在 flutter 上获取当前用户的位置。 I shortlisted it to two but cannot find which one would be more suitable and why.我将它列入了两个候选名单,但找不到哪个更合适以及为什么。 These are the flutter geolocator package and Google API.这些是 flutter 地理定位器 package 和 Google API。

Does someone have any experience using those?有人有使用这些的经验吗? Which one would you recommend?你会推荐哪一个?

The app I am building needs high accuracy.我正在构建的应用程序需要高精度。 I made a test and saw there is a little difference between the results obtained from the two.我做了一个测试,发现两者得到的结果有一点差异。 However, I have no idea which one is the most accurate.但是,我不知道哪一个是最准确的。

Example:例子:

Geolocator: Latitude = xx.xxx3127地理定位器:纬度 = xx.xxx3127

Google API: Latitude =xx.xxx322谷歌 API:纬度 =xx.xxx322

Geolocator is a good option to use for finding location地理定位器是用于查找位置的好选择

You can see the code in the attached link to find out how you can use it.您可以在附加链接中查看代码以了解如何使用它。

Flutter Geolocator and Google Maps: Show static location Flutter 地理定位器和谷歌地图:显示 static 位置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM