| OLD | NEW |
| 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 '../theme/colors.dart' as colors; | |
| 6 import 'basic.dart'; | 5 import 'basic.dart'; |
| 7 import 'material.dart'; | 6 import 'material.dart'; |
| 8 import "theme.dart"; | |
| 9 | 7 |
| 10 /// A material design card | 8 /// A material design card |
| 11 /// | 9 /// |
| 12 /// <https://www.google.com/design/spec/components/cards.html> | 10 /// <https://www.google.com/design/spec/components/cards.html> |
| 13 class Card extends Component { | 11 class Card extends Component { |
| 14 Card({ String key, this.child, this.color }) : super(key: key); | 12 Card({ String key, this.child, this.color }) : super(key: key); |
| 15 | 13 |
| 16 final Widget child; | 14 final Widget child; |
| 17 final Color color; | 15 final Color color; |
| 18 | 16 |
| 19 Widget build() { | 17 Widget build() { |
| 20 return new Container( | 18 return new Container( |
| 21 margin: const EdgeDims.all(4.0), | 19 margin: const EdgeDims.all(4.0), |
| 22 child: new Material( | 20 child: new Material( |
| 23 color: color, | 21 color: color, |
| 24 type: MaterialType.card, | 22 type: MaterialType.card, |
| 25 level: 2, | 23 level: 2, |
| 26 child: new ClipRRect( | 24 child: new ClipRRect( |
| 27 xRadius: edges[MaterialType.card], | 25 xRadius: edges[MaterialType.card], |
| 28 yRadius: edges[MaterialType.card], | 26 yRadius: edges[MaterialType.card], |
| 29 child: child | 27 child: child |
| 30 ) | 28 ) |
| 31 ) | 29 ) |
| 32 ); | 30 ); |
| 33 } | 31 } |
| 34 } | 32 } |
| OLD | NEW |