[Swipeable] Allow widget to swipe backward

Signed-off-by: Sahil Kumar <[email protected]>
This commit is contained in:
Sahil Kumar
2020-12-08 17:01:29 +05:30
parent e78bdc6027
commit c133002118
+2 -4
View File
@@ -70,13 +70,11 @@ class _SwipeableState extends State<Swipeable> with TickerProviderStateMixin {
}
void _handleDragUpdate(DragUpdateDetails details) {
print(_moveAnimation.value.dx);
final delta = details.primaryDelta;
if (delta.isNegative) return;
_dragExtent += delta;
if (_dragExtent.isNegative) return;
var movePastThresholdPixels = widget.threshold;
var newPos = _dragExtent.abs() / context.size.width;