Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: sky/framework/components/checkbox.dart

Issue 1019633004: Change how events are handled in Effen (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: cr changes Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/framework/components/button_base.dart ('k') | sky/framework/components/drawer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/components/checkbox.dart
diff --git a/sky/framework/components/checkbox.dart b/sky/framework/components/checkbox.dart
index 8a0d325b11ebe40a6fbda2b7d1e77902e838af82..738332841f00b41407078e5924be5956b42dee7a 100644
--- a/sky/framework/components/checkbox.dart
+++ b/sky/framework/components/checkbox.dart
@@ -58,27 +58,28 @@ class Checkbox extends ButtonBase {
bool checked;
ValueChanged onChanged;
- Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key) {
- events.listen('gesturetap', _handleClick);
- }
+ Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key);
void _handleClick(sky.Event e) {
onChanged(!checked);
}
- Node build() {
- return new Container(
- style: _style,
- children: [
- new Container(
- style: highlight ? _containerHighlightStyle : _containerStyle,
- children: [
- new Container(
- style: checked ? _checkedStyle : _uncheckedStyle
- )
- ]
- )
- ]
+ Node buildContent() {
+ return new EventTarget(
+ new Container(
+ style: _style,
+ children: [
+ new Container(
+ style: highlight ? _containerHighlightStyle : _containerStyle,
+ children: [
+ new Container(
+ style: checked ? _checkedStyle : _uncheckedStyle
+ )
+ ]
+ )
+ ]
+ ),
+ onGestureTap: _handleClick
);
}
}
« no previous file with comments | « sky/framework/components/button_base.dart ('k') | sky/framework/components/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698