image_masking_flutter 0.0.1
image_masking_flutter: ^0.0.1 copied to clipboard
The Image Masking Flutter Plugin allows developers to create an interactive image reveal effect.
image_masking_flutter #
The Image Masking Flutter Plugin allows developers to create an interactive image reveal effect. It allows users to interactively reveal or color an image by dragging their fingers across the screen.
Installation #
To use this package, add image_masking_flutter as a dependency in your pubspec.yaml file:
dependencies:
image_masking_flutter: ^1.0.0
Usage #
import 'package:image_masking_flutter/image_masking_flutter.dart';
GIF #
Example #
///* Create a GlobalKey *///
final GlobalKey<ImageMaskingWidgetState> _imageMaskingKey = GlobalKey<ImageMaskingWidgetState>();
///* Use the below widget with properties according to your requirements *///
ImageMaskingWidget(
key: _imageMaskingKey,
height: MediaQuery.of(context).size.height/2,
width: MediaQuery.of(context).size.width,
margin: EdgeInsets.symmetric(vertical: MediaQuery.of(context).size.height/4,horizontal: 15),
decoration: BoxDecoration(
border: Border.all(color: Colors.black, width: 2)),
coloredImage: "assets/images/kid_color.jpeg",
unColoredImage: "assets/images/kid_uncolor.jpeg",
)
///* For reset the view *///
_imageMaskingKey.currentState?.resetView();
Author #
Follow LinkedIn: @Sohit-Sharma
Contributing #
If you find a bug or want to contribute to this project, feel free to open an issue or submit a pull request. Contributions are welcome!