diff --git a/packages/flutter/lib/widgets/card.dart b/packages/flutter/lib/widgets/card.dart index 87b196fd74..c9b9aa3fcc 100644 --- a/packages/flutter/lib/widgets/card.dart +++ b/packages/flutter/lib/widgets/card.dart @@ -23,11 +23,7 @@ class Card extends Component { color: color, type: MaterialType.card, level: 2, - child: new ClipRRect( - xRadius: edges[MaterialType.card], - yRadius: edges[MaterialType.card], - child: child - ) + child: child ) ); } diff --git a/packages/flutter/lib/widgets/material.dart b/packages/flutter/lib/widgets/material.dart index 74daa24c71..a0e3f86184 100644 --- a/packages/flutter/lib/widgets/material.dart +++ b/packages/flutter/lib/widgets/material.dart @@ -48,6 +48,20 @@ class Material extends Component { } Widget build() { + Widget contents = child; + if (child != null) { + contents = new DefaultTextStyle( + style: Theme.of(this).text.body1, + child: contents + ); + if (edges[type] != null) { + contents = new ClipRRect( + xRadius: edges[type], + yRadius: edges[type], + child: contents + ); + } + } return new AnimatedContainer( behavior: implicitlyAnimate(const Duration(milliseconds: 200)), decoration: new BoxDecoration( @@ -56,10 +70,7 @@ class Material extends Component { boxShadow: level == 0 ? null : shadows[level], shape: type == MaterialType.circle ? Shape.circle : Shape.rectangle ), - child: child == null ? null : new DefaultTextStyle( - style: Theme.of(this).text.body1, - child: child - ) + child: contents ); } }