scratcher
scratcher copied to clipboard
unable to use on website using flutter
I have a website which need this scratch package but i am unable to do it here is my full code
import 'package:flutter/material.dart';
import 'package:scratcher/scratcher.dart';
// import 'advanced.dart';
// import 'basic.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
body: SafeArea(
child: Container(
height: 800,
width: 800,
color: Colors.amber,
child: 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,
),
),
),
),
),
);
}
}