我刚刚为扑动做出了第一笔贡献。我可以很好地使用我的包,但是由于飞镖分析发现一些错误,所以我的得分很低。我正在使用GestureDetector类,并为onLongPressDragStart
,onLongPressDragUpdate
和onLongPressDragUp
实现了回调。根据发布我的软件包后的分析,这些是错误的:
Fix lib/planner_class.dart. (-57.81 points)
Analysis of lib/planner_class.dart failed with 3 errors:
line 163 col 21: The named parameter 'onLongPressDragStart' isn't defined.
line 168 col 21: The named parameter 'onLongPressDragUpdate' isn't defined.
line 173 col 21: The named parameter 'onLongPressDragUp' isn't defined.
但是这些是在GestureDetector类(https://docs.flutter.io/flutter/widgets/GestureDetector-class.html)中定义的。我的冒犯代码可以在github(https://github.com/ourtrip/planner/blob/7c4c6bb8533ab9ecb66c61ba757a88ba2aaf8092/lib/planner_class.dart#L163)上找到。奇怪的是,其他回调(onScaleStart
和onScaleUpdate
)也不会引发错误。
有错误的dart包可以在这里找到:https://pub.dartlang.org/packages/planner#-analysis-tab-。
那么可能是什么原因造成的呢?以及我该如何解决?
答案 0 :(得分:0)
我有同样的问题。
这里的问题是,您可能已经使用了Flutter的最新功能。您必须查看用于实现的小部件/参数。并在pubspec.yaml中设置最低Flutter SDK版本,以使pub.dev知道您的软件包将支持哪种Flutter SDK版本(例如,最新功能)。
例如,如下编辑您的pubspec:
environment:
sdk: ">=2.2.2 <3.0.0"
flutter: ">=1.12.0 <2.0.0"
最诚挚的问候