Pass shadowColor param to SceneBuilder (#15714)

* pass shadowColor param to SceneBuilder

* add doc comment and diagnostic node for shadowColor

* Add missing shadowColor param
This commit is contained in:
Jonah Williams
2018-03-20 21:05:28 -07:00
committed by GitHub
parent ad9506d25a
commit d518bd2dc8
2 changed files with 10 additions and 1 deletions

View File

@@ -764,9 +764,11 @@ class PhysicalModelLayer extends ContainerLayer {
@required this.clipPath,
@required this.elevation,
@required this.color,
@required this.shadowColor,
}) : assert(clipPath != null),
assert(elevation != null),
assert(color != null);
assert(color != null),
assert(shadowColor != null);
/// The path to clip in the parent's coordinate system.
///
@@ -786,6 +788,9 @@ class PhysicalModelLayer extends ContainerLayer {
/// (as described at [Layer]).
Color color;
/// The shadow color.
Color shadowColor;
@override
void addToScene(ui.SceneBuilder builder, Offset layerOffset) {
if (!debugDisablePhysicalShapeLayers)
@@ -793,6 +798,7 @@ class PhysicalModelLayer extends ContainerLayer {
path: clipPath.shift(layerOffset),
elevation: elevation,
color: color,
shadowColor: shadowColor,
);
addChildrenToScene(builder, layerOffset);
if (!debugDisablePhysicalShapeLayers)

View File

@@ -1495,6 +1495,7 @@ abstract class _RenderPhysicalModelBase<T> extends _RenderCustomClip<T> {
super.debugFillProperties(description);
description.add(new DoubleProperty('elevation', elevation));
description.add(new DiagnosticsProperty<Color>('color', color));
description.add(new DiagnosticsProperty<Color>('shadowColor', color));
}
}
@@ -1596,6 +1597,7 @@ class RenderPhysicalModel extends _RenderPhysicalModelBase<RRect> {
clipPath: offsetClipPath,
elevation: elevation,
color: color,
shadowColor: shadowColor,
);
context.pushLayer(physicalModel, super.paint, offset, childPaintBounds: offsetBounds);
} else {
@@ -1702,6 +1704,7 @@ class RenderPhysicalShape extends _RenderPhysicalModelBase<Path> {
clipPath: offsetPath,
elevation: elevation,
color: color,
shadowColor: shadowColor,
);
context.pushLayer(physicalModel, super.paint, offset, childPaintBounds: offsetBounds);
} else {