错误:没有名称为“kind”的命名参数。}):super(debugOwner:debugOwner,kind:kind);
我所做的是更新flutter和依赖项,以免影响编译的时间,但它并没有起到多大作用
class PhotoViewGestureRecognizer extends ScaleGestureRecognizer {
PhotoViewGestureRecognizer({
this.hitDetector,
Object? debugOwner,
this.validateAxis,
PointerDeviceKind? kind,
}) : super(debugOwner: debugOwner, kind: kind);
final HitCornersDetector? hitDetector;
final Axis? validateAxis;
Map<int, Offset> _pointerLocations = <int, Offset>{};
Offset? _initialFocalPoint;
Offset? _currentFocalPoint;
bool ready = true;
1条答案
按热度按时间9lowa7mx1#
实际上,问题在于
PhotoViewGestureRecognizer
类的定义。您的
PhotoViewGestureRecognizer
扩展了ScaleGestureRecognizer
,它只有following参数可以分配给它。这表明ScaleGestureRecognizer
类中没有命名参数kind
。可能的解决方案:
理想情况下,修复后查看类
PhotoViewGestureRecognizer
中的数据类型变量kind
。我认为你需要将数据类型从
PointerDeviceKind?
更改为Set<PointerDeviceKind>?
,这可以在超级构造函数中的ScaleGestureRecognizer
类的参数supportedDevices
中提供。