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

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

Issue 971183002: Initial commit of Effen reactive framework experiment for Sky (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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/flingcurve.dart ('k') | sky/examples/fn/widgets/inksplash.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 part of widgets;
2
3 const String kAssetBase = '/sky/assets/material-design-icons';
4
5 class Icon extends Component {
6
7 Style style;
8 int size;
9 String type;
10 sky.EventListener onClick;
11
12 Icon({
13 String key,
14 this.style,
15 this.size,
16 this.type: '',
17 this.onClick
18 }) : super(key: key);
19
20 Node render() {
21 String category = '';
22 String subtype = '';
23 List<String> parts = type.split('/');
24 if (parts.length == 2) {
25 category = parts[0];
26 subtype = parts[1];
27 }
28
29 return new Image(
30 style: style,
31 onClick: onClick,
32 width: size,
33 height: size,
34 src: '${kAssetBase}/${category}/2x_web/ic_${subtype}_${size}dp.png'
35 );
36 }
37 }
OLDNEW
« no previous file with comments | « sky/examples/fn/widgets/flingcurve.dart ('k') | sky/examples/fn/widgets/inksplash.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698