Commit d547103f authored by Collin Jackson's avatar Collin Jackson

Move ClipRRect logic from Card to Material (fixes rounded corners on top of date picker dialog)

parent 1a15cb2d
...@@ -23,11 +23,7 @@ class Card extends Component { ...@@ -23,11 +23,7 @@ class Card extends Component {
color: color, color: color,
type: MaterialType.card, type: MaterialType.card,
level: 2, level: 2,
child: new ClipRRect( child: child
xRadius: edges[MaterialType.card],
yRadius: edges[MaterialType.card],
child: child
)
) )
); );
} }
......
...@@ -48,6 +48,20 @@ class Material extends Component { ...@@ -48,6 +48,20 @@ class Material extends Component {
} }
Widget build() { 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( return new AnimatedContainer(
behavior: implicitlyAnimate(const Duration(milliseconds: 200)), behavior: implicitlyAnimate(const Duration(milliseconds: 200)),
decoration: new BoxDecoration( decoration: new BoxDecoration(
...@@ -56,10 +70,7 @@ class Material extends Component { ...@@ -56,10 +70,7 @@ class Material extends Component {
boxShadow: level == 0 ? null : shadows[level], boxShadow: level == 0 ? null : shadows[level],
shape: type == MaterialType.circle ? Shape.circle : Shape.rectangle shape: type == MaterialType.circle ? Shape.circle : Shape.rectangle
), ),
child: child == null ? null : new DefaultTextStyle( child: contents
style: Theme.of(this).text.body1,
child: child
)
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment