xvrh / lottie-flutter

Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.
https://pub.dev/packages/lottie
MIT License
1.13k stars 197 forks source link

How can I let the click or slide event penetrate the lottie animation? #356

Closed Robert-Stackflow closed 1 month ago

Robert-Stackflow commented 1 month ago

When I draw a lottie animation on the screen, such as when I draw a heart animation when double-clicking the screen, I will not be able to click or slide the part of the screen where the lottie animation exists until the animation is completed. How can I let the click or slide event penetrate the lottie animation?

xvrh commented 1 month ago

If you want to totally ignore the animation during hit testing, you can wrap your Lottie widget with a IgnorePointer. See doc: https://api.flutter.dev/flutter/widgets/IgnorePointer-class.html

Robert-Stackflow commented 1 month ago

Thank you! Perfect solution!