mchome / flutter_colorpicker

HSV(HSB)/HSL/RGB/Material color picker inspired by all the good design for your amazing flutter apps.
https://pub.dev/packages/flutter_colorpicker
MIT License
339 stars 198 forks source link

App can't debug when colorpicker is added to the pubspec.yaml #56

Closed dninet closed 2 years ago

dninet commented 2 years ago

I get the following output, followed by the usual "BUILD FAILED"

../../../.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' ('../../../development/flutter/packages/flutter/lib/src/gestures/events.dart').
 - 'PointerEvent' is from 'package:flutter/src/gestures/events.dart' ('../../../development/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) {
                                          ^

../../../development/flutter/packages/flutter/lib/src/gestures/monodrag.dart:256:8: Context: This is the overridden method ('addAllowedPointer').
  void addAllowedPointer(PointerEvent event) {

I've completely cleaned flutter and downloaded all packages after the error showed up. Didn't work.

aldycool commented 2 years ago

Hi, I think this happens due to flutter 2.5 (the latest flutter version as per writing). If you've just installed Flutter (or you've upgraded your existing installation), it is likely that you have upgraded to 2.5. To downgrade Flutter SDK is not easy, since they've removed the flutter version command. As of now, probably needs to uninstall + reinstall it (or use some kind of flutter version switcher like: https://github.com/leoafarias/fvm).

mchome commented 2 years ago

Try using this:

dependencies:
  flutter_colorpicker:
    git:
      url: git://github.com/mchome/flutter_colorpicker.git

I will update the pub version asap.

mchome commented 2 years ago

0.6.0 is released.