vintage / scratcher

Scratch card widget which temporarily hides content from user.
https://pub.dev/packages/scratcher
MIT License
572 stars 67 forks source link

Does not work in iOS, Flutter 3.13.0 #51

Closed curoyou-nsuslab closed 1 year ago

curoyou-nsuslab commented 1 year ago

There is an issue with the library not working properly in Flutter 3.13.0, which was updated today.

VladKodletov commented 1 year ago

Actually too. Dont work visual scratch effect after update to Flutter 3.13.0.

leventkantaroglu commented 1 year ago

For my case, it is not working on real iOS devices with Flutter 3.10.0.

curoyou-nsuslab commented 1 year ago

@leventkantaroglu 3.10.0? is not 3.13.0?? What is your device os version? is it 16.6?

dvasea1 commented 1 year ago

Yes, in my case the same is not working. Iphone with IOS: 16.6 @leventkantaroglu

leventkantaroglu commented 1 year ago

@leventkantaroglu 3.10.0? is not 3.13.0?? What is your device os version? is it 16.6?

yes, iOS 16.6 - iPhone XR

quadbyte commented 1 year ago

Broken on iPhone mini iOS 15.5 with Flutter 3.13.0 Working on iPhone mini iOS 15.5 with Flutter 3.10.6

This is a major show stopper.

rusudinu commented 1 year ago

Did some digging, so far, the issues seems to be the fact that Colors.transparent does not work properly. For example, if here:

  Paint _getMainPaint(double strokeWidth) {
    final paint = Paint()
      ..strokeCap = StrokeCap.round
      ..color = Colors.transparent
      ..strokeWidth = strokeWidth
      ..blendMode = BlendMode.src
      ..strokeJoin = StrokeJoin.round
      ..style = PaintingStyle.stroke;

    return paint;
  }

instead of Colors.transparent you put Colors.green, you get the desired line. Probably it's due to the fact that since flutter 3.13 we have the Impeller rendering engine and that probably treats transparency in a different way.

curoyou-nsuslab commented 1 year ago

@xrusu So this is actually an Impeller issue before it's a library issue?...

rusudinu commented 1 year ago

@curoyou-nsuslab I think I have a fix for this, I will open a PR after I check if it works correctly on android aswell / make a replacement package because I think the author does not contribute anymore to this

rusudinu commented 1 year ago

I have created a pull request with the fix #52 . Hopefully the maintainer will merge it fast, if not, you can use this drop-in replacement that has the fix for ios: https://pub.dev/packages/flutter_scratcher

vintage commented 1 year ago

New version 2.4.0 got released - https://pub.dev/packages/scratcher Thanks again @xrusu for straightforward fix!