flutter小部件:flutter_map don' t工作,缺少latlng功能

发布于 2025-02-10 03:30:21 字数 265 浏览 2 评论 0原文

我要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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

贩梦商人 2025-02-17 03:30:21

简短答案

安装 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:

enter image description here

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 your pubspec.yaml, so you have to explicitly add latlong2: ^x.x.x to your pubspec.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文