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

Side by Side Diff: sky/examples/fn/widgets/box.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/README.md ('k') | sky/examples/fn/widgets/button.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 Box extends Component { 3 class Box extends Component {
4 4
5 static Style _style = new Style(''' 5 static Style _style = new Style('''
6 display: flex; 6 display: flex;
7 flex-direction: column; 7 flex-direction: column;
8 border-radius: 4px; 8 border-radius: 4px;
9 border: 1px solid gray; 9 border: 1px solid gray;
10 margin: 10px;''' 10 margin: 10px;'''
11 ); 11 );
12 12
13 static Style _titleStyle = new Style(''' 13 static Style _titleStyle = new Style('''
14 flex: 1; 14 flex: 1;
15 text-align: center; 15 text-align: center;
16 font-size: 10px; 16 font-size: 10px;
17 padding: 8px 8px 4px 8px;''' 17 padding: 8px 8px 4px 8px;'''
18 ); 18 );
19 19
20 static Style _contentStyle = new Style(''' 20 static Style _contentStyle = new Style('''
21 flex: 1; 21 flex: 1;
22 padding: 4px 8px 8px 8px;''' 22 padding: 4px 8px 8px 8px;'''
23 ); 23 );
24 24
25 String title; 25 String title;
26 List<Node> children; 26 List<Node> children;
27 27
28 Box({String key, this.title, this.children }) : super(key: key); 28 Box({String key, this.title, this.children }) : super(key: key);
29 29
30 Node render() { 30 Node build() {
31 return new Container( 31 return new Container(
32 style: _style, 32 style: _style,
33 children: [ 33 children: [
34 new Container( 34 new Container(
35 key: 'Title', 35 key: 'Title',
36 style: _titleStyle, 36 style: _titleStyle,
37 children: [new Text(title)] 37 children: [new Text(title)]
38 ), 38 ),
39 new Container( 39 new Container(
40 key: 'Content', 40 key: 'Content',
41 style: _contentStyle, 41 style: _contentStyle,
42 children: children 42 children: children
43 ), 43 ),
44 ] 44 ]
45 ); 45 );
46 } 46 }
47 } 47 }
OLDNEW
« no previous file with comments | « sky/examples/fn/README.md ('k') | sky/examples/fn/widgets/button.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698