Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: The parameter 'event' of the method 'AlwaysWinPanGestureRecognizer... when importing color picker package in my project

Welcome I have a problem on importing flutter_colorpicker package when i just import it in my project: import 'package:flutter_colorpicker/flutter_colorpicker.dart'; I gets this error:

/C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_colorpicker-0.5.0/lib/src/hsv_picker.dart:730:43: Error: The parameter 'event' of the method 'AlwaysWinPanGestureRecognizer.addAllowedPointer' has type 'PointerDownEvent', which does not match the corresponding type, 'PointerEvent', in the overridden method, 'DragGestureRecognizer.addAllowedPointer'.
 - 'PointerDownEvent' is from 'package:flutter/src/gestures/events.dart' ('/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart').
 - 'PointerEvent' is from 'package:flutter/src/gestures/events.dart' ('/C:/src/flutter/packages/flutter/lib/src/gestures/events.dart').
Change to a supertype of 'PointerEvent', or, for a covariant parameter, a subtype.
  void addAllowedPointer(PointerDownEvent event) {
                                          ^
/C:/src/flutter/packages/flutter/lib/src/gestures/monodrag.dart:256:8: Context: This is the overridden method ('addAllowedPointer').
  void addAllowedPointer(PointerEvent event) {
       ^

this is the result of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.2.1, on Microsoft Windows [Version 10.0.17763.1577], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.6)
[√] IntelliJ IDEA Community Edition (version 2021.1)
[√] VS Code (version 1.56.2)
[√] Connected device (3 available)

• No issues found!

and this is project's dependencies:

dependencies:
  flutter:
    sdk: flutter
  shared_preferences: ^2.0.6
  flutter_colorpicker: ^0.5.0

does anyone have a solution? any thanks for every one

like image 959
moaaz Avatar asked Jun 17 '21 15:06

moaaz


Video Answer


1 Answers

just change flutter_colorpicker version to 0.4.0

like image 114
fc barc3lona Avatar answered Oct 23 '22 17:10

fc barc3lona