Commit 20d401de authored by Hans Muller's avatar Hans Muller Committed by GitHub

Revert the new "physical model" shadow rendering code (#8636)

parent 19ad3ea4
...@@ -7,6 +7,7 @@ import 'package:flutter/rendering.dart'; ...@@ -7,6 +7,7 @@ import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'constants.dart'; import 'constants.dart';
import 'shadows.dart';
import 'theme.dart'; import 'theme.dart';
/// Signature for the callback used by ink effects to obtain the rectangle for the effect. /// Signature for the callback used by ink effects to obtain the rectangle for the effect.
...@@ -228,28 +229,11 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin { ...@@ -228,28 +229,11 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
) )
); );
if (config.type == MaterialType.circle) { if (config.type == MaterialType.circle) {
contents = new PhysicalModel( contents = new ClipOval(child: contents);
shape: BoxShape.circle, } else if (kMaterialEdges[config.type] != null) {
elevation: config.elevation, contents = new ClipRRect(
color: backgroundColor, borderRadius: radius,
child: contents, child: contents
);
} else if (config.type == MaterialType.transparency) {
if (radius == null) {
contents = new ClipRect(child: contents);
} else {
contents = new ClipRRect(
borderRadius: radius,
child: contents
);
}
} else {
contents = new PhysicalModel(
shape: BoxShape.rectangle,
borderRadius: radius ?? BorderRadius.zero,
elevation: config.elevation,
color: backgroundColor,
child: contents,
); );
} }
if (config.type != MaterialType.transparency) { if (config.type != MaterialType.transparency) {
...@@ -263,6 +247,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin { ...@@ -263,6 +247,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
child: new Container( child: new Container(
decoration: new BoxDecoration( decoration: new BoxDecoration(
borderRadius: radius, borderRadius: radius,
boxShadow: config.elevation == 0 ? null : kElevationToShadow[config.elevation],
backgroundColor: backgroundColor, backgroundColor: backgroundColor,
shape: config.type == MaterialType.circle ? BoxShape.circle : BoxShape.rectangle shape: config.type == MaterialType.circle ? BoxShape.circle : BoxShape.rectangle
), ),
......
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