Prevent double-dismissing of Dismissables, center card_collection under-text
This commit is contained in:
parent
9c4ed3f82d
commit
e4d9e320b0
@ -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 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
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 {
|
|||||||
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 {
|
|||||||
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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user