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 |
); |
} |
} |