Revert the new "physical model" shadow rendering code (#8636)
This commit is contained in:
@@ -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
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user