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';
import 'package:flutter/widgets.dart';
import 'constants.dart';
import 'shadows.dart';
import 'theme.dart';
/// 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 {
)
);
if (config.type == MaterialType.circle) {
contents = new PhysicalModel(
shape: BoxShape.circle,
elevation: config.elevation,
color: backgroundColor,
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,
contents = new ClipOval(child: contents);
} else if (kMaterialEdges[config.type] != null) {
contents = new ClipRRect(
borderRadius: radius,
child: contents
);
}
if (config.type != MaterialType.transparency) {
......@@ -263,6 +247,7 @@ class _MaterialState extends State<Material> with TickerProviderStateMixin {
child: new Container(
decoration: new BoxDecoration(
borderRadius: radius,
boxShadow: config.elevation == 0 ? null : kElevationToShadow[config.elevation],
backgroundColor: backgroundColor,
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