flutter_image_cropper icon indicating copy to clipboard operation
flutter_image_cropper copied to clipboard

Image_cropper_platform_interface-7.2.0 Error: The method 'toARGB32' isn't defined for the class 'Color'.

Open vasudev391 opened this issue 3 months ago • 9 comments

Image_cropper_platform_interface-7.2.0 getting below error

.pub-cache/hosted/pub.dev/image_cropper_platform_interface-7.2.0/lib/src/models/settings.dart:244:59: Error: The method 'toARGB32' isn't defined for the class 'Color'.

stuck over here from last week need to provide import update but due to this error unable to do.

let me know if any one have alternative solution

vasudev391 avatar Sep 22 '25 11:09 vasudev391

Workaround for Flutter + image_cropper_platform_interface bug

If you get the error:

with image_cropper_platform_interface 7.x and Flutter stable (September 2025), you can temporarily fix it by replacing all .toARGB32() calls with .value in:

.pub-cache/hosted/pub.dev/image_cropper_platform_interface-7.2.0/lib/src/models/settings.dart

Image

This is a temporary patch until the package is updated.

shinesoftware avatar Sep 22 '25 12:09 shinesoftware

Pls fix this asap

sg-devender avatar Sep 29 '25 13:09 sg-devender

Is there any resolution for this?

rajat-kumar-pz avatar Oct 01 '25 12:10 rajat-kumar-pz

pls fix it

mosfeqanik avatar Oct 05 '25 09:10 mosfeqanik

Image_cropper_platform_interface-7.2.0 getting below error

.pub-cache/hosted/pub.dev/image_cropper_platform_interface-7.2.0/lib/src/models/settings.dart:244:59: Error: The method 'toARGB32' isn't defined for the class 'Color'.

stuck over here from last week need to provide import update but due to this error unable to do.

let me know if any one have alternative solution

add this dependency .it works for me

flutter pub add image_cropper:8.1.0

mosfeqanik avatar Oct 05 '25 11:10 mosfeqanik

Image_cropper_platform_interface-7.2.0 getting below error .pub-cache/hosted/pub.dev/image_cropper_platform_interface-7.2.0/lib/src/models/settings.dart:244:59: Error: The method 'toARGB32' isn't defined for the class 'Color'. stuck over here from last week need to provide import update but due to this error unable to do. let me know if any one have alternative solution

add this dependency .it works for me

flutter pub add image_cropper:8.1.0

Already done remove cap sign and same version but in pub.cache hosted yaml platform interface is ^7.0.0 and that will contain error so this will not work and i don't find this is best approach

vasudev391 avatar Oct 06 '25 06:10 vasudev391

A fix for this would be nice:

EDIT: image_cropper_platform_interface: 7.1.0

Forcing 7.1.0 seems to work now as well.(Note I am on Flutter 3.27.4)

Kam5678 avatar Oct 14 '25 18:10 Kam5678

A fix for this would be nice:

EDIT: image_cropper_platform_interface: 7.1.0

Forcing 7.1.0 seems to work now as well.(Note I am on Flutter 3.27.4)

better to be follow @shinesoftware approach at least. and hopefully owner will fix this ASAP soon

vasudev391 avatar Oct 15 '25 07:10 vasudev391

A fix for this would be nice:

EDIT: image_cropper_platform_interface: 7.1.0

Forcing 7.1.0 seems to work now as well.(Note I am on Flutter 3.27.4)

This worked for me too, even though I never imported this package, forcing the dependency version in the pubspec.yaml

dependency_overrides:
  image_cropper: 9.0.0
  image_cropper_platform_interface: 7.1.0

I'm also on Flutter 3.27.4.

aardrop avatar Oct 27 '25 21:10 aardrop