OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 import '../fn.dart'; | 5 import '../fn.dart'; |
6 import 'button_base.dart'; | 6 import 'button_base.dart'; |
7 import 'material.dart'; | 7 import 'material.dart'; |
8 | 8 |
9 typedef void ValueChanged(value); | 9 typedef void ValueChanged(value); |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 border-radius: 5px; | 43 border-radius: 5px; |
44 background-color: black; | 44 background-color: black; |
45 margin: 2px;''' | 45 margin: 2px;''' |
46 ); | 46 ); |
47 | 47 |
48 Radio({ | 48 Radio({ |
49 Object key, | 49 Object key, |
50 this.onChanged, | 50 this.onChanged, |
51 this.value, | 51 this.value, |
52 this.groupValue | 52 this.groupValue |
53 }) : super(key: key) { | 53 }) : super(key: key); |
54 events.listen('gesturetap', _handleClick); | |
55 } | |
56 | 54 |
57 Node build() { | 55 Node buildContent() { |
58 return new Material( | 56 return new EventTarget( |
59 style: highlight ? _highlightStyle : _style, | 57 new Material( |
60 children: value == groupValue ? [new Container(style: _dotStyle )] : [] | 58 style: highlight ? _highlightStyle : _style, |
| 59 children: value == groupValue ? [new Container(style: _dotStyle )] : [] |
| 60 ), |
| 61 onGestureTap: _handleClick |
61 ); | 62 ); |
62 } | 63 } |
63 | 64 |
64 void _handleClick(_) { | 65 void _handleClick(_) { |
65 onChanged(value); | 66 onChanged(value); |
66 } | 67 } |
67 } | 68 } |
OLD | NEW |