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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/widgets/ink_well.dart ('k') | sky/sdk/lib/framework/widgets/menu_item.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/widgets/material.dart
diff --git a/sky/sdk/lib/framework/widgets/material.dart b/sky/sdk/lib/framework/widgets/material.dart
index 89f3a56a198dcc2ed058a26b6bd5bd8a7bb7d021..3f53c1b452a308ae5931894babe8aa2ed8d2d25f 100644
--- a/sky/sdk/lib/framework/widgets/material.dart
+++ b/sky/sdk/lib/framework/widgets/material.dart
@@ -2,28 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+import '../painting/box_painter.dart';
+import '../theme2/colors.dart';
+import '../theme2/edges.dart';
+import '../theme2/shadows.dart';
import 'wrappers.dart';
class Material extends Component {
- Material({ Object key, this.content, this.level: 0 }) : super(key: key);
+ Material({
+ Object key,
+ this.child,
+ this.edge: MaterialEdge.card,
+ this.level: 0,
+ this.color
+ }) : super(key: key);
- // static final List<Style> _shadowStyle = [
- // null,
- // new Style('box-shadow: ${Shadow[1]}'),
- // new Style('box-shadow: ${Shadow[2]}'),
- // new Style('box-shadow: ${Shadow[3]}'),
- // new Style('box-shadow: ${Shadow[4]}'),
- // new Style('box-shadow: ${Shadow[5]}'),
- // ];
-
- final UINode content;
+ final UINode child;
final int level;
+ final MaterialEdge edge;
+ final Color color;
+
+ // TODO(ianh): we should make this animate level changes and color changes
UINode build() {
- // TODO(eseidel): Add a shadow.
- // return new StyleNode(content, _shadowStyle[level]);
- return content;
+ return new Container(
+ decoration: new BoxDecoration(
+ boxShadow: shadows[level],
+ borderRadius: edges[edge],
+ backgroundColor: color == null ? Grey[50] : color,
+ shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle
+ ),
+ child: child
+ );
}
}
« no previous file with comments | « sky/sdk/lib/framework/widgets/ink_well.dart ('k') | sky/sdk/lib/framework/widgets/menu_item.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698