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 27 matching lines...) Expand all Loading... |
38 margin: 2px;''' | 38 margin: 2px;''' |
39 ); | 39 ); |
40 | 40 |
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 build() { |
49 return new Container( | 49 return new Container( |
50 style: _highlight ? _highlightStyle : _style, | 50 style: _highlight ? _highlightStyle : _style, |
51 children: value == groupValue ? | 51 children: value == groupValue ? |
52 [super.render(), new Container( style : _dotStyle )] : [super.render()
] | 52 [super.build(), new Container( style : _dotStyle )] : [super.build()] |
53 )..events.listen('click', _handleClick); | 53 )..events.listen('click', _handleClick); |
54 } | 54 } |
55 | 55 |
56 void _handleClick(_) { | 56 void _handleClick(_) { |
57 onChanged(value); | 57 onChanged(value); |
58 } | 58 } |
59 } | 59 } |
OLD | NEW |