Index: sky/sdk/lib/widgets/material.dart |
diff --git a/sky/sdk/lib/widgets/material.dart b/sky/sdk/lib/widgets/material.dart |
index 73b52cb66f8372c9efd909ff6fa42a766af5cf7b..864cf1a6af204ac7dd1dba5c20582b17a2492a37 100644 |
--- a/sky/sdk/lib/widgets/material.dart |
+++ b/sky/sdk/lib/widgets/material.dart |
@@ -3,6 +3,7 @@ |
// found in the LICENSE file. |
import '../painting/box_painter.dart'; |
+import '../theme/colors.dart' as colors; |
import '../theme/edges.dart'; |
import '../theme/shadows.dart'; |
import 'basic.dart'; |
@@ -24,6 +25,17 @@ class Material extends Component { |
final MaterialEdge edge; |
final Color color; |
+ Color get backgroundColor { |
+ if (color != null) |
+ return color; |
+ switch (Theme.of(this).brightness) { |
+ case ThemeBrightness.light: |
+ return colors.Grey[50]; |
+ case ThemeBrightness.dark: |
+ return colors.Grey[850]; |
+ } |
+ } |
+ |
// TODO(ianh): we should make this animate level changes and color changes |
Widget build() { |
@@ -31,7 +43,7 @@ class Material extends Component { |
decoration: new BoxDecoration( |
boxShadow: shadows[level], |
borderRadius: edges[edge], |
- backgroundColor: color == null ? Theme.of(this).backgroundColor : color, |
+ backgroundColor: backgroundColor, |
shape: edge == MaterialEdge.circle ? Shape.circle : Shape.rectangle |
), |
child: new DefaultTextStyle(style: Theme.of(this).text.body1, child: child) |