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