scratch_reveal library
High-performance GPU-accelerated scratch card and scratch-to-reveal canvas widget for Flutter.
Features sub-millisecond bitmask progress tracking, smooth auto-reveal transitions, turnkey RewardScratchCard with celebratory confetti bursts, and customizable brush styles.
Implementation by Govind Tank.
Classes
- RewardScratchCard
- A turnkey, gamified reward scratch card for Fintech, E-Commerce, and Loyalty apps inspired by Google Pay, CRED, and PhonePe.
- ScratchBitmaskGrid
- Ultra-fast 2D spatial bitmask grid for estimating scratched area percentage in sub-millisecond time.
- ScratchFoilPreset
- Preset foil patterns and textures for scratch cards.
- ScratchPainter
-
High-performance CustomPainter that cuts realistic textured scratch paths out of a cover foil layer using GPU
BlendMode.clear, and renders flying foil dust particles. - ScratchParticle
- Represents an airborne foil shaving or sparkle dust particle emitted while scratching.
- ScratchReveal
- An interactive scratch-to-reveal card widget for Flutter with realistic coin/brush physical texture, flying metallic foil dust particles, and sub-millisecond bitmask progress tracking.
- ScratchRevealState
- State controller for ScratchReveal exposing reset and programmatic reveal methods.
- ScratchStroke
- Represents a single scratch point or stroke line segment.
Enums
- ScratchBrushShape
- Brush tip shapes and textures for scratching.
- ScratchRevealAnimation
- Transition animations when the scratch threshold is achieved.