Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/imageview360.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,18 @@ 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,
this.autoRotate = false,
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,
Expand Down Expand Up @@ -82,6 +87,10 @@ class _ImageView360State extends State<ImageView360> {
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
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down