Skip to content
pubscout

scratcher

2.5.0, released 3 years ago by vaultomb.com

Scratch card widget which temporarily hides content from the user.

WASM-ready
$ flutter pub add scratcher
Source repository

What it does

Provides a scratch card widget that covers content with a solid color or custom image, allowing users to scratch it away to reveal what's underneath. It supports tracking progress, threshold callbacks, and programmatic control.

AI-written summary of version 2.5.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want to build a scratch-off game or promotional feature in your app
  • You need to temporarily hide content until the user interacts with it

Skip it when

  • You need complex physics or game engines
  • You are targeting web platforms other than CanvasKit

Strengths

  • Supports custom cover images and solid colors
  • Tracks scratch progress and triggers callbacks on threshold
  • Programmatic control with reset and reveal methods

Weaknesses

  • Web support is limited to CanvasKit only

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
Scratcher(
  brushSize: 30,
  threshold: 50,
  color: Colors.red,
  onChange: (value) => print("Scratch progress: $value%"),
  onThreshold: () => print("Threshold reached, you won!"),
  child: Container(
    height: 300,
    width: 300,
    color: Colors.blue,
  ),
)

Alternatives

Packages that do the same job and could replace scratcher.