Reset the Dimissable fade animation on slow flings

This commit is contained in:
Hans Muller 2015-08-14 14:14:11 -07:00
parent 5183eb9b63
commit 2c5c4538fc

View File

@ -150,11 +150,14 @@ class Dismissable extends StatefulComponent {
if (!_isActive)
return EventDisposition.ignored;
_dragUnderway = false;
if (_isHorizontalFlingGesture(event)) {
_dragUnderway = false;
_dragX = event.velocityX.sign;
_fadePerformance.fling(velocity: event.velocityX.abs() * _kFlingVelocityScale);
} else {
_fadePerformance.reverse();
}
return EventDisposition.processed;
}