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

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

Issue 1179713004: Material and RaisedButton. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
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';
6 import '../theme2/colors.dart';
7 import '../theme2/edges.dart';
8 import '../theme2/shadows.dart';
5 import 'wrappers.dart'; 9 import 'wrappers.dart';
6 10
7 class Material extends Component { 11 class Material extends Component {
8 12
9 Material({ Object key, this.content, this.level: 0 }) : super(key: key); 13 Material({
14 Object key,
15 this.child,
16 this.edge: MaterialEdge.card,
17 this.level: 0,
18 this.color
19 }) : super(key: key);
10 20
11 // static final List<Style> _shadowStyle = [ 21 final UINode child;
12 // null,
13 // new Style('box-shadow: ${Shadow[1]}'),
14 // new Style('box-shadow: ${Shadow[2]}'),
15 // new Style('box-shadow: ${Shadow[3]}'),
16 // new Style('box-shadow: ${Shadow[4]}'),
17 // new Style('box-shadow: ${Shadow[5]}'),
18 // ];
19
20 final UINode content;
21 final int level; 22 final int level;
23 final MaterialEdge edge;
24 final Color color;
22 25
23 UINode build() { 26 UINode build() {
24 // TODO(eseidel): Add a shadow. 27 return new Container(
25 // return new StyleNode(content, _shadowStyle[level]); 28 decoration: new BoxDecoration(
26 return content; 29 boxShadow: shadows[level],
30 borderRadius: edges[edge],
31 backgroundColor: color == null ? Grey[50] : color,
32 shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle
33 ),
34 child: child
35 );
27 } 36 }
28 37
29 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698