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

Side by Side Diff: sky/examples/fn/widgets/icon.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
OLDNEW
1 part of widgets; 1 part of widgets;
2 2
3 const String kAssetBase = '/sky/assets/material-design-icons'; 3 const String kAssetBase = '/sky/assets/material-design-icons';
4 4
5 class Icon extends Component { 5 class Icon extends Component {
6 6
7 Style style; 7 Style style;
8 int size; 8 int size;
9 String type; 9 String type;
10 10
11 Icon({ 11 Icon({
12 String key, 12 String key,
13 this.style, 13 this.style,
14 this.size, 14 this.size,
15 this.type: '' 15 this.type: ''
16 }) : super(key: key); 16 }) : super(key: key);
17 17
18 Node render() { 18 Node build() {
19 String category = ''; 19 String category = '';
20 String subtype = ''; 20 String subtype = '';
21 List<String> parts = type.split('/'); 21 List<String> parts = type.split('/');
22 if (parts.length == 2) { 22 if (parts.length == 2) {
23 category = parts[0]; 23 category = parts[0];
24 subtype = parts[1]; 24 subtype = parts[1];
25 } 25 }
26 26
27 return new Image( 27 return new Image(
28 style: style, 28 style: style,
29 width: size, 29 width: size,
30 height: size, 30 height: size,
31 src: '${kAssetBase}/${category}/2x_web/ic_${subtype}_${size}dp.png' 31 src: '${kAssetBase}/${category}/2x_web/ic_${subtype}_${size}dp.png'
32 ); 32 );
33 } 33 }
34 } 34 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/floating_action_button.dart ('k') | sky/examples/fn/widgets/inksplash.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698