Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: sky/examples/fn/widgets/checkbox.dart

Issue 992033002: Change the name of Component.render to Component.build in Effen (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: README Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/examples/fn/widgets/button.dart ('k') | sky/examples/fn/widgets/drawer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/button.dart ('k') | sky/examples/fn/widgets/drawer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698