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
1976ae1d
Commit
1976ae1d
authored
Sep 21, 2015
by
Adam Barth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RenderToggleable should use a gesture recognizer
We no longer have gesture events.
parent
205335f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
toggleable.dart
packages/flutter/lib/src/rendering/toggleable.dart
+25
-3
No files found.
packages/flutter/lib/src/rendering/toggleable.dart
View file @
1976ae1d
...
...
@@ -5,6 +5,8 @@
import
'dart:sky'
as
sky
;
import
'package:sky/animation.dart'
;
import
'package:sky/gestures.dart'
;
import
'package:sky/src/rendering/sky_binding.dart'
;
import
'package:sky/src/rendering/box.dart'
;
import
'package:sky/src/rendering/object.dart'
;
import
'package:sky/src/rendering/proxy_box.dart'
;
...
...
@@ -30,13 +32,33 @@ abstract class RenderToggleable extends RenderConstrainedBox {
}
EventDisposition
handleEvent
(
sky
.
Event
event
,
BoxHitTestEntry
entry
)
{
if
(
event
is
sky
.
GestureEvent
&&
event
.
type
==
'gesturetap
'
)
{
_
onChanged
(!
_value
);
return
EventDisposition
.
consum
ed
;
if
(
event
.
type
==
'pointerdown
'
)
{
_
tap
.
addPointer
(
event
);
return
EventDisposition
.
process
ed
;
}
return
EventDisposition
.
ignored
;
}
TapGestureRecognizer
_tap
;
void
attach
()
{
super
.
attach
();
_tap
=
new
TapGestureRecognizer
(
router:
SkyBinding
.
instance
.
pointerRouter
,
onTap:
_handleTap
);
}
void
detatch
()
{
_tap
.
dispose
();
_tap
=
null
;
super
.
detach
();
}
void
_handleTap
()
{
_onChanged
(!
_value
);
}
bool
_value
;
bool
get
value
=>
_value
;
...
...
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