Commit e4d9e320 authored by Hans Muller's avatar Hans Muller

Prevent double-dismissing of Dismissables, center card_collection under-text

parent 9c4ed3f8
......@@ -77,9 +77,8 @@ class CardCollectionApp extends App {
)
);
Widget backgroundText = new Center(
child: new Text("Swipe in either direction", style: backgroundTextStyle)
);
Widget backgroundText =
new Text("Swipe in either direction", style: backgroundTextStyle);
// The background Widget appears behind the Dismissable card when the card
// moves to the left or right. The Positioned widget ensures that the
......
......@@ -100,6 +100,9 @@ class Dismissable extends StatefulComponent {
}
EventDisposition _handlePointerDown(sky.PointerEvent event) {
if (_fadePerformance.isAnimating)
return EventDisposition.processed;
_dragUnderway = true;
_dragX = 0.0;
_fadePerformance.progress = 0.0;
......@@ -110,6 +113,9 @@ class Dismissable extends StatefulComponent {
if (!_isActive)
return EventDisposition.ignored;
if (_fadePerformance.isAnimating)
return EventDisposition.processed;
double oldDragX = _dragX;
_dragX += event.dx;
if (oldDragX.sign != _dragX.sign)
......@@ -123,6 +129,9 @@ class Dismissable extends StatefulComponent {
if (!_isActive)
return EventDisposition.ignored;
if (_fadePerformance.isAnimating)
return EventDisposition.processed;
_dragUnderway = false;
if (_fadePerformance.isCompleted)
_startResizePerformance();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment