diff --git a/lib/imageview360.dart b/lib/imageview360.dart index 2637e85..782dcbc 100644 --- a/lib/imageview360.dart +++ b/lib/imageview360.dart @@ -32,6 +32,9 @@ class ImageView360 extends StatefulWidget { // Callback function to provide you the index of current image when image frame is changed. final Function(int? currentImageIndex)? onImageIndexChanged; + final void Function()? onDragStart; + final void Function()? onDragEnd; + ImageView360({ required Key key, required this.imageList, @@ -39,6 +42,8 @@ class ImageView360 extends StatefulWidget { this.allowSwipeToRotate = true, this.rotationCount = 1, this.swipeSensitivity = 1, + this.onDragEnd, + this.onDragStart, this.rotationDirection = RotationDirection.clockwise, this.frameChangeDuration = const Duration(milliseconds: 80), this.onImageIndexChanged, @@ -82,6 +87,10 @@ class _ImageView360State extends State { GestureDetector( onHorizontalDragEnd: (details) { localPosition = 0.0; + widget.onDragEnd?.call(); + }, + onHorizontalDragDown: (details) { + widget.onDragStart?.call(); }, onHorizontalDragUpdate: (details) { // Swipe check,if allowed than only will image move diff --git a/pubspec.yaml b/pubspec.yaml index c96fe0b..e891e6e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,9 +1,9 @@ name: imageview360 description: A Flutter package which provides 360 view of the images with rotation and gesture customisations. -version: 1.2.0 +version: 1.3.1 homepage: https://github.com/hd-motion/flutter_imageview_360 environment: - sdk: '>=2.12.0 <3.0.0' + sdk: '>=2.12.0 <4.0.0' dependencies: flutter: