| OLD | NEW |
| 1 part of widgets; | 1 part of widgets; |
| 2 | 2 |
| 3 class Checkbox extends ButtonBase { | 3 class Checkbox extends ButtonBase { |
| 4 | 4 |
| 5 bool checked; | 5 bool checked; |
| 6 ValueChanged onChanged; | 6 ValueChanged onChanged; |
| 7 | 7 |
| 8 static Style _style = new Style(''' | 8 static Style _style = new Style(''' |
| 9 transform: translateX(0); | 9 transform: translateX(0); |
| 10 display: flex; | 10 display: flex; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 border-style: solid; | 47 border-style: solid; |
| 48 border-top: none; | 48 border-top: none; |
| 49 border-left: none; | 49 border-left: none; |
| 50 border-right-width: 2px; | 50 border-right-width: 2px; |
| 51 border-bottom-width: 2px; | 51 border-bottom-width: 2px; |
| 52 border-color: #0f9d58;''' | 52 border-color: #0f9d58;''' |
| 53 ); | 53 ); |
| 54 | 54 |
| 55 Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key); | 55 Checkbox({ Object key, this.onChanged, this.checked }) : super(key: key); |
| 56 | 56 |
| 57 Node render() { | 57 Node build() { |
| 58 return new Container( | 58 return new Container( |
| 59 style: _style, | 59 style: _style, |
| 60 children: [ | 60 children: [ |
| 61 super.render(), | 61 super.build(), |
| 62 new Container( | 62 new Container( |
| 63 style: _highlight ? _containerHighlightStyle : _containerStyle, | 63 style: _highlight ? _containerHighlightStyle : _containerStyle, |
| 64 children: [ | 64 children: [ |
| 65 new Container( | 65 new Container( |
| 66 style: checked ? _checkedStyle : _uncheckedStyle | 66 style: checked ? _checkedStyle : _uncheckedStyle |
| 67 ) | 67 ) |
| 68 ] | 68 ] |
| 69 ) | 69 ) |
| 70 ] | 70 ] |
| 71 )..events.listen('click', _handleClick); | 71 )..events.listen('click', _handleClick); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void _handleClick(sky.Event e) { | 74 void _handleClick(sky.Event e) { |
| 75 onChanged(!checked); | 75 onChanged(!checked); |
| 76 } | 76 } |
| 77 } | 77 } |
| OLD | NEW |