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

Side by Side Diff: sky/sdk/lib/widgets/material.dart

Issue 1173293005: Make UINode's key a String (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: nit Created 5 years, 6 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/sdk/lib/widgets/ink_well.dart ('k') | sky/sdk/lib/widgets/menu_divider.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import '../painting/box_painter.dart'; 5 import '../painting/box_painter.dart';
6 import '../theme2/colors.dart'; 6 import '../theme2/colors.dart';
7 import '../theme2/edges.dart'; 7 import '../theme2/edges.dart';
8 import '../theme2/shadows.dart'; 8 import '../theme2/shadows.dart';
9 import 'basic.dart'; 9 import 'basic.dart';
10 10
11 class Material extends Component { 11 class Material extends Component {
12 12
13 Material({ 13 Material({
14 Object key, 14 String key,
15 this.child, 15 this.child,
16 this.edge: MaterialEdge.card, 16 this.edge: MaterialEdge.card,
17 this.level: 0, 17 this.level: 0,
18 this.color 18 this.color
19 }) : super(key: key); 19 }) : super(key: key);
20 20
21 final UINode child; 21 final UINode child;
22 final int level; 22 final int level;
23 final MaterialEdge edge; 23 final MaterialEdge edge;
24 final Color color; 24 final Color color;
25 25
26 // TODO(ianh): we should make this animate level changes and color changes 26 // TODO(ianh): we should make this animate level changes and color changes
27 27
28 UINode build() { 28 UINode build() {
29 return new Container( 29 return new Container(
30 decoration: new BoxDecoration( 30 decoration: new BoxDecoration(
31 boxShadow: shadows[level], 31 boxShadow: shadows[level],
32 borderRadius: edges[edge], 32 borderRadius: edges[edge],
33 backgroundColor: color == null ? Grey[50] : color, 33 backgroundColor: color == null ? Grey[50] : color,
34 shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle 34 shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle
35 ), 35 ),
36 child: child 36 child: child
37 ); 37 );
38 } 38 }
39 39
40 } 40 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/ink_well.dart ('k') | sky/sdk/lib/widgets/menu_divider.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698