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

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

Issue 993033003: Move example fn widgets into sky/framework/components (Closed) Base URL: git@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
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
11 Icon({
12 String key,
13 this.style,
14 this.size,
15 this.type: ''
16 }) : super(key: key);
17
18 Node build() {
19 String category = '';
20 String subtype = '';
21 List<String> parts = type.split('/');
22 if (parts.length == 2) {
23 category = parts[0];
24 subtype = parts[1];
25 }
26
27 return new Image(
28 style: style,
29 width: size,
30 height: size,
31 src: '${kAssetBase}/${category}/2x_web/ic_${subtype}_${size}dp.png'
32 );
33 }
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