flutter_scratch_card 2.0.0 copy "flutter_scratch_card: ^2.0.0" to clipboard
flutter_scratch_card: ^2.0.0 copied to clipboard

A production-ready, highly customizable Flutter scratch card SDK with ImageProvider overlays, themes, brushes, haptics, multi-area scratching, persistence, and accessibility.

Changelog #

2.0.0 #

Breaking changes #

  • overlayImage is now ImageProvider? instead of ui.Image?.
  • Pass a decoded ui.Image via the new overlayUiImage parameter.
  • Prefer overlayImage: AssetImage(...)overlayImageAsset is deprecated.

Architecture #

  • Introduced ScratchEngine / DefaultScratchEngine separating logic from presentation.
  • Added multi-area support via ScratchArea and onAreaComplete.
  • Added ScratchReward / ScratchRewardConfig for multi and async rewards.
  • Added accessibility semantics (semanticLabel, semanticHint, reveal action).
  • Added ScratchPerformanceConfig for grid resolution, point caps, throttling.
  • Added pluggable ScratchStateStorage + MemoryScratchStateStorage and stateKey.
  • Controller: pause(), resume(), setProgress(), isComplete, isPaused.

Migration #

1.2.0 #

  • Added ScratchCardTheme with classic / metallic / golden / premium / neon / minimal.
  • Added brush shapes: circle, square, rounded rectangle, custom.
  • Added ScratchRevealShape (rectangle, circle, rounded rectangle, custom).
  • Added ScratchCompletionConfig / effects: none, fade, scale, glow, confetti, shake.
  • Added optional ScratchSoundConfig with ScratchSoundPlayer adapter (no audio dependency).
  • Added ScratchAnimationConfig for reveal / reset / completion timing.

1.1.0 #

  • Added ImageProvider overlay support (network / asset / memory) via Flutter image cache.
  • Expanded callbacks: onScratchStart, onScratch, onScratchEnd, onMilestone, onComplete, onReset.
  • Added ScratchBrush with size, softness, hardness, spacing, and presets.
  • Dedicated onComplete (fires once until reset; works with auto-reveal and controller reveal).
  • Added ScratchHapticConfig with throttled scratch feedback.
  • Improved reset: controller.reset(animated: true) + ScratchResetConfig.
  • Documentation and example updates.

1.0.0 #

  • Initial release of flutter_scratch_card.
  • Support for solid color, gradient, and image asset overlays.
  • Grid-based progress tracking for high performance.
  • Milestone triggers (progressTriggers) to fire events during scratching.
  • Animated background support (Lottie and GIF) with lifecycle management.
  • Celebration animations play on top of the reward layer.
  • Integrated haptic feedback support.
  • Production-ready ScratchController for programmatic control.
  • Optimized rendering using RepaintBoundary.
5
likes
160
points
499
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A production-ready, highly customizable Flutter scratch card SDK with ImageProvider overlays, themes, brushes, haptics, multi-area scratching, persistence, and accessibility.

Repository (GitHub)
View/report issues

Topics

#scratch-card #ui #animation #rewards #flutter

License

MIT (license)

Dependencies

flutter, lottie

More

Packages that depend on flutter_scratch_card