@@ -256,6 +256,7 @@ class PhotoView extends StatefulWidget {
256
256
this .onDragEnd,
257
257
this .onDragUpdate,
258
258
this .onScaleEnd,
259
+ this .onLongPressStart,
259
260
this .customSize,
260
261
this .gestureDetectorBehavior,
261
262
this .tightMode,
@@ -294,6 +295,7 @@ class PhotoView extends StatefulWidget {
294
295
this .onDragEnd,
295
296
this .onDragUpdate,
296
297
this .onScaleEnd,
298
+ this .onLongPressStart,
297
299
this .customSize,
298
300
this .gestureDetectorBehavior,
299
301
this .tightMode,
@@ -401,6 +403,10 @@ class PhotoView extends StatefulWidget {
401
403
/// particular location.
402
404
final PhotoViewImageScaleEndCallback ? onScaleEnd;
403
405
406
+ /// A pointer that might cause a tap has contacted the screen at a particular
407
+ /// location.
408
+ final PhotoViewImageLongPressStartCallback ? onLongPressStart;
409
+
404
410
/// [HitTestBehavior] to be passed to the internal gesture detector.
405
411
final HitTestBehavior ? gestureDetectorBehavior;
406
412
@@ -537,6 +543,7 @@ class _PhotoViewState extends State<PhotoView>
537
543
onDragEnd: widget.onDragEnd,
538
544
onDragUpdate: widget.onDragUpdate,
539
545
onScaleEnd: widget.onScaleEnd,
546
+ onLongPressStart: widget.onLongPressStart,
540
547
outerSize: computedOuterSize,
541
548
gestureDetectorBehavior: widget.gestureDetectorBehavior,
542
549
tightMode: widget.tightMode,
@@ -566,6 +573,7 @@ class _PhotoViewState extends State<PhotoView>
566
573
onDragEnd: widget.onDragEnd,
567
574
onDragUpdate: widget.onDragUpdate,
568
575
onScaleEnd: widget.onScaleEnd,
576
+ onLongPressStart: widget.onLongPressStart,
569
577
outerSize: computedOuterSize,
570
578
gestureDetectorBehavior: widget.gestureDetectorBehavior,
571
579
tightMode: widget.tightMode,
@@ -649,6 +657,13 @@ typedef PhotoViewImageScaleEndCallback = Function(
649
657
PhotoViewControllerValue controllerValue,
650
658
);
651
659
660
+ /// A type definition for a callback when the user long press start
661
+ typedef PhotoViewImageLongPressStartCallback = Function (
662
+ BuildContext context,
663
+ LongPressStartDetails details,
664
+ PhotoViewControllerValue controllerValue,
665
+ );
666
+
652
667
/// A type definition for a callback to show a widget while the image is loading, a [ImageChunkEvent] is passed to inform progress
653
668
typedef LoadingBuilder = Widget Function (
654
669
BuildContext context,
0 commit comments