hnvn / flutter_image_cropper

A Flutter plugin for Android and iOS supports cropping images
994 stars 392 forks source link

An error about `WidgetStateColor` when running debug mode on the web #519

Closed KalaliEhsan closed 1 month ago

KalaliEhsan commented 1 month ago

I wanna run the web debug mode for test this package:

flutter run -d web-server --web-hostname=my-host --web-port=my-port

But an error occurred like this:

../../../.pub-cache/hosted/pub.dev/image_cropper_for_web-6.0.1/lib/src/cropper_actionbar.dart:34:21: Error: The getter 'WidgetStateColor' isn't defined for the class '_CropperActionBarState'.
 - '_CropperActionBarState' is from 'package:image_cropper_for_web/src/cropper_actionbar.dart' ('../../../.pub-cache/hosted/pub.dev/image_cropper_for_web-6.0.1/lib/src/cropper_actionbar.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WidgetStateColor'.
                    WidgetStateColor.resolveWith((states) => iconColor),

The current version of this package:

image_cropper: ^8.0.1

And content of its folder in the .pub-cache like this photo:

Screenshot 1403-05-20 at 5 43 55 in the afternoon
hnvn commented 1 month ago

which flutter version are you using?

KalaliEhsan commented 1 month ago

flutter doctor:

[✓] Flutter (Channel stable, 3.19.4, on macOS 14.2 23C64 darwin-arm64, locale en-IR)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (2 available)
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources

• No issues found!

@hnvn

ndrsrc commented 1 month ago

Same error here

hnvn commented 1 month ago

oh, WidgetSateColor is only available from Flutter v3.22, please upgrade your flutter environment, I will increase flutter version constraints in next package release