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
a15b27d4
Commit
a15b27d4
authored
Sep 16, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove support for onGestureFoo from Listener
Please use GestureDetector instead.
parent
699fa241
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
98 deletions
+21
-98
framework.dart
packages/flutter/lib/src/widgets/framework.dart
+20
-91
scrollable.dart
packages/flutter/lib/src/widgets/scrollable.dart
+1
-7
No files found.
packages/flutter/lib/src/widgets/framework.dart
View file @
a15b27d4
...
...
@@ -663,102 +663,31 @@ typedef EventDisposition PointerEventListener(sky.PointerEvent e);
typedef
EventDisposition
EventListener
(
sky
.
Event
e
);
class
Listener
extends
TagNode
{
Listener
({
Key
key
,
Widget
child
,
EventListener
onWheel
,
GestureEventListener
onGestureFlingCancel
,
GestureEventListener
onGestureFlingStart
,
GestureEventListener
onGestureScrollStart
,
GestureEventListener
onGestureScrollUpdate
,
GestureEventListener
onGestureLongPress
,
GestureEventListener
onGestureTap
,
GestureEventListener
onGestureTapDown
,
GestureEventListener
onGestureShowPress
,
PointerEventListener
onPointerCancel
,
PointerEventListener
onPointerDown
,
PointerEventListener
onPointerMove
,
PointerEventListener
onPointerUp
,
Map
<
String
,
EventListener
>
custom
})
:
listeners
=
_createListeners
(
onWheel:
onWheel
,
onGestureFlingCancel:
onGestureFlingCancel
,
onGestureFlingStart:
onGestureFlingStart
,
onGestureScrollUpdate:
onGestureScrollUpdate
,
onGestureScrollStart:
onGestureScrollStart
,
onGestureTap:
onGestureTap
,
onGestureTapDown:
onGestureTapDown
,
onGestureLongPress:
onGestureLongPress
,
onGestureShowPress:
onGestureShowPress
,
onPointerCancel:
onPointerCancel
,
onPointerDown:
onPointerDown
,
onPointerMove:
onPointerMove
,
onPointerUp:
onPointerUp
,
custom:
custom
),
super
(
key:
key
,
child:
child
);
final
Map
<
String
,
EventListener
>
listeners
;
static
Map
<
String
,
EventListener
>
_createListeners
({
EventListener
onWheel
,
GestureEventListener
onGestureFlingCancel
,
GestureEventListener
onGestureFlingStart
,
GestureEventListener
onGestureScrollStart
,
GestureEventListener
onGestureScrollUpdate
,
GestureEventListener
onGestureTap
,
GestureEventListener
onGestureTapDown
,
GestureEventListener
onGestureLongPress
,
GestureEventListener
onGestureShowPress
,
PointerEventListener
onPointerCancel
,
PointerEventListener
onPointerDown
,
PointerEventListener
onPointerMove
,
PointerEventListener
onPointerUp
,
Map
<
String
,
EventListener
>
custom
})
{
var
listeners
=
custom
!=
null
?
new
HashMap
<
String
,
EventListener
>.
from
(
custom
)
:
new
HashMap
<
String
,
EventListener
>();
if
(
onWheel
!=
null
)
listeners
[
'wheel'
]
=
onWheel
;
if
(
onGestureFlingCancel
!=
null
)
listeners
[
'gestureflingcancel'
]
=
onGestureFlingCancel
;
if
(
onGestureFlingStart
!=
null
)
listeners
[
'gestureflingstart'
]
=
onGestureFlingStart
;
if
(
onGestureScrollStart
!=
null
)
listeners
[
'gesturescrollstart'
]
=
onGestureScrollStart
;
if
(
onGestureScrollUpdate
!=
null
)
listeners
[
'gesturescrollupdate'
]
=
onGestureScrollUpdate
;
if
(
onGestureTap
!=
null
)
listeners
[
'gesturetap'
]
=
onGestureTap
;
if
(
onGestureTapDown
!=
null
)
listeners
[
'gesturetapdown'
]
=
onGestureTapDown
;
if
(
onGestureLongPress
!=
null
)
listeners
[
'gesturelongpress'
]
=
onGestureLongPress
;
if
(
onGestureShowPress
!=
null
)
listeners
[
'gestureshowpress'
]
=
onGestureShowPress
;
if
(
onPointerCancel
!=
null
)
listeners
[
'pointercancel'
]
=
onPointerCancel
;
if
(
onPointerDown
!=
null
)
listeners
[
'pointerdown'
]
=
onPointerDown
;
if
(
onPointerMove
!=
null
)
listeners
[
'pointermove'
]
=
onPointerMove
;
if
(
onPointerUp
!=
null
)
listeners
[
'pointerup'
]
=
onPointerUp
;
return
listeners
;
}
EventDisposition
_handleEvent
(
sky
.
Event
e
)
{
EventListener
listener
=
listeners
[
e
.
type
];
if
(
listener
!=
null
)
{
return
listener
(
e
);
}
PointerEventListener
this
.
onPointerDown
,
PointerEventListener
this
.
onPointerMove
,
PointerEventListener
this
.
onPointerUp
,
PointerEventListener
this
.
onPointerCancel
})
:
super
(
key:
key
,
child:
child
);
final
PointerEventListener
onPointerDown
;
final
PointerEventListener
onPointerMove
;
final
PointerEventListener
onPointerUp
;
final
PointerEventListener
onPointerCancel
;
EventDisposition
_handleEvent
(
sky
.
Event
event
)
{
if
(
onPointerDown
!=
null
&&
event
.
type
==
'pointerdown'
)
return
onPointerDown
(
event
);
if
(
onPointerMove
!=
null
&&
event
.
type
==
'pointermove'
)
return
onPointerMove
(
event
);
if
(
onPointerUp
!=
null
&&
event
.
type
==
'pointerup'
)
return
onPointerUp
(
event
);
if
(
onPointerCancel
!=
null
&&
event
.
type
==
'pointercancel'
)
return
onPointerCancel
(
event
);
return
EventDisposition
.
ignored
;
}
}
abstract
class
Component
extends
Widget
{
...
...
packages/flutter/lib/src/widgets/scrollable.dart
View file @
a15b27d4
...
...
@@ -100,8 +100,7 @@ abstract class Scrollable extends StatefulComponent {
onHorizontalDragEnd:
_getDragEndHandler
(
ScrollDirection
.
horizontal
),
child:
new
Listener
(
child:
buildContent
(),
onPointerDown:
_handlePointerDown
,
onWheel:
_handleWheel
onPointerDown:
_handlePointerDown
)
);
}
...
...
@@ -195,11 +194,6 @@ abstract class Scrollable extends StatefulComponent {
}
}
EventDisposition
_handleWheel
(
sky
.
WheelEvent
event
)
{
scrollBy
(-
event
.
offsetY
);
return
EventDisposition
.
processed
;
}
final
List
<
ScrollListener
>
_listeners
=
new
List
<
ScrollListener
>();
void
addListener
(
ScrollListener
listener
)
{
_listeners
.
add
(
listener
);
...
...
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