FloodFill_Image icon indicating copy to clipboard operation
FloodFill_Image copied to clipboard

Prevent fill on zoom

Open AdamovicBoban opened this issue 4 years ago • 2 comments

Hi,

how to prevent filling when zoom is started ? can you help me ?

InteractiveViewer( panEnabled: true, minScale: 1, maxScale: 4, child: SizedBox( width: 300, height: 300, child: FloodFillImage( imageProvider: NetworkImage("https://previews.123rf.com/images/inhasemiankova/inhasemiankova1606/inhasemiankova160600012/68493780-vector-coloring-simple-sun-round-mandala-for-children.jpg"), fillColor: _fillColor, avoidColor: [Colors.transparent, Colors.black], tolerance: 100, ), ), ),

AdamovicBoban avatar May 24 '21 14:05 AdamovicBoban

You could use the onInteractionStart callback from InteractiveViewer See: https://api.flutter.dev/flutter/widgets/InteractiveViewer-class.html and disable the fill function with "isFillActive" parameter set to false.

garlen-javier avatar May 24 '21 15:05 garlen-javier

Hi Garlen,

Please give me an example in the code, I am almost new to flutter . Thank You


i think the gesture need to be changed, it would be better if the fill should be done by onTapUp or onLongPress

AdamovicBoban avatar May 24 '21 15:05 AdamovicBoban