OLD | NEW |
1 part of widgets; | 1 part of widgets; |
2 | 2 |
3 class Radio extends ButtonBase { | 3 class Radio extends ButtonBase { |
4 | 4 |
5 Object value; | 5 Object value; |
6 Object groupValue; | 6 Object groupValue; |
7 ValueChanged onChanged; | 7 ValueChanged onChanged; |
8 | 8 |
9 static Style _style = new Style(''' | 9 static Style _style = new Style(''' |
10 transform: translateX(0); | 10 transform: translateX(0); |
(...skipping 30 matching lines...) Expand all Loading... |
41 Radio({ | 41 Radio({ |
42 Object key, | 42 Object key, |
43 this.onChanged, | 43 this.onChanged, |
44 this.value, | 44 this.value, |
45 this.groupValue | 45 this.groupValue |
46 }) : super(key: key); | 46 }) : super(key: key); |
47 | 47 |
48 Node render() { | 48 Node render() { |
49 return new Container( | 49 return new Container( |
50 style: _highlight ? _highlightStyle : _style, | 50 style: _highlight ? _highlightStyle : _style, |
51 onClick: _handleClick, | |
52 onPointerDown: _handlePointerDown, | |
53 onPointerUp: _handlePointerUp, | |
54 onPointerCancel: _handlePointerCancel, | |
55 children: value == groupValue ? | 51 children: value == groupValue ? |
56 [super.render(), new Container( style : _dotStyle )] : [super.render()
] | 52 [super.render(), new Container( style : _dotStyle )] : [super.render()
] |
57 ); | 53 )..events.listen('click', _handleClick); |
58 } | 54 } |
59 | 55 |
60 void _handleClick(sky.Event e) { | 56 void _handleClick(_) { |
61 onChanged(value); | 57 onChanged(value); |
62 } | 58 } |
63 } | 59 } |
OLD | NEW |