flutter小部件:flutter_map don' t工作,缺少latlng功能
我要o测试此( https://pub.dev/packages/flutter_map_map ) 。 但是我可以找到要进口的方法来解决对此方法的依赖: latlng 。
该方法用于在第一个示例的许多地方设置一个点。 有人可以告诉我要进口哪些lib来解决这种依赖性?
I want o test this (https://pub.dev/packages/flutter_map) widget map from Flutter.
but i can found what to import to solve dependency to this method: LatLng.
This method is used to set a point on many places on the first example.
Can someone tell me what lib to import to solve this dependency?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短答案:
安装 latlong2 简单地通过做
flutter> flutter flutter pub添加添加latlong2
长答案:
在pub.dev的右侧您可以找到一个依赖项列表,在这种情况下,是:
您应该已经能够能够do
导入'软件包:latlong2/latlong.dart';
,但可能会通知您不要使用pubspec.yaml
中未定义的依赖项,因此您有要明确将latlong2: ^xxx
添加到您的PubSpec。Short answer:
Install latlong2 package simply by doing
flutter pub add latlong2
Long answer:
On the right side of pub.dev you can find a dependency list, in this case it's this:
You should already be able to do
import 'package:latlong2/latlong.dart';
but probably the linter will notify you not to use dependencies that are not defined in yourpubspec.yaml
, so you have to explicitly addlatlong2: ^x.x.x
to your pubspec.