scratcher 0.0.5 scratcher: ^0.0.5 copied to clipboard
Scratchable widget which temporarily hides content from user. Supports color & image area.
scratcher #
Scratchable widget which temporarily hides content from user.
Features #
- Cover content with color
- Cover content with image
- Smooth calculations
- Fully configurable
Getting started #
You should ensure that you add the scratcher as a dependency in your Flutter project.
dependencies:
scratcher: "^0.0.5"
You should then run flutter packages upgrade
or update your packages in IntelliJ.
Example Project #
There is a crazy example project in the example
folder. Check it out to see most of the available options.
Setting up #
First, you need to import the scratcher:
import 'package:scratcher/scratcher.dart';
Now you are ready to cover any widget with the scratchy area:
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,
),
)