Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
e4d9e320
Commit
e4d9e320
authored
Aug 05, 2015
by
Hans Muller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent double-dismissing of Dismissables, center card_collection under-text
parent
9c4ed3f8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
card_collection.dart
packages/flutter/example/widgets/card_collection.dart
+2
-3
dismissable.dart
packages/flutter/lib/widgets/dismissable.dart
+9
-0
No files found.
packages/flutter/example/widgets/card_collection.dart
View file @
e4d9e320
...
...
@@ -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
...
...
packages/flutter/lib/widgets/dismissable.dart
View file @
e4d9e320
...
...
@@ -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
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment