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 { ...@@ -77,9 +77,8 @@ class CardCollectionApp extends App {
) )
); );
Widget backgroundText = new Center( Widget backgroundText =
child: new Text("Swipe in either direction", style: backgroundTextStyle) new Text("Swipe in either direction", style: backgroundTextStyle);
);
// The background Widget appears behind the Dismissable card when the card // The background Widget appears behind the Dismissable card when the card
// moves to the left or right. The Positioned widget ensures that the // moves to the left or right. The Positioned widget ensures that the
......
...@@ -100,6 +100,9 @@ class Dismissable extends StatefulComponent { ...@@ -100,6 +100,9 @@ class Dismissable extends StatefulComponent {
} }
EventDisposition _handlePointerDown(sky.PointerEvent event) { EventDisposition _handlePointerDown(sky.PointerEvent event) {
if (_fadePerformance.isAnimating)
return EventDisposition.processed;
_dragUnderway = true; _dragUnderway = true;
_dragX = 0.0; _dragX = 0.0;
_fadePerformance.progress = 0.0; _fadePerformance.progress = 0.0;
...@@ -110,6 +113,9 @@ class Dismissable extends StatefulComponent { ...@@ -110,6 +113,9 @@ class Dismissable extends StatefulComponent {
if (!_isActive) if (!_isActive)
return EventDisposition.ignored; return EventDisposition.ignored;
if (_fadePerformance.isAnimating)
return EventDisposition.processed;
double oldDragX = _dragX; double oldDragX = _dragX;
_dragX += event.dx; _dragX += event.dx;
if (oldDragX.sign != _dragX.sign) if (oldDragX.sign != _dragX.sign)
...@@ -123,6 +129,9 @@ class Dismissable extends StatefulComponent { ...@@ -123,6 +129,9 @@ class Dismissable extends StatefulComponent {
if (!_isActive) if (!_isActive)
return EventDisposition.ignored; return EventDisposition.ignored;
if (_fadePerformance.isAnimating)
return EventDisposition.processed;
_dragUnderway = false; _dragUnderway = false;
if (_fadePerformance.isCompleted) if (_fadePerformance.isCompleted)
_startResizePerformance(); _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