Unverified Commit 7eeafb12 authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

Consider backgroundBlendMode in equality of BoxDecoration (#100788)

parent ef8e3578
......@@ -320,6 +320,7 @@ class BoxDecoration extends Decoration {
&& other.borderRadius == borderRadius
&& listEquals<BoxShadow>(other.boxShadow, boxShadow)
&& other.gradient == gradient
&& other.backgroundBlendMode == backgroundBlendMode
&& other.shape == shape;
}
......@@ -331,6 +332,7 @@ class BoxDecoration extends Decoration {
borderRadius,
boxShadow == null ? null : Object.hashAll(boxShadow!),
gradient,
backgroundBlendMode,
shape,
);
......
......@@ -95,4 +95,17 @@ void main() {
);
expect(clipPath, isLookLikeExpectedPath);
});
test('BoxDecorations with different blendModes are not equal', () {
// Regression test for https://github.com/flutter/flutter/issues/100754.
const BoxDecoration one = BoxDecoration(
color: Color(0x00000000),
backgroundBlendMode: BlendMode.color,
);
const BoxDecoration two = BoxDecoration(
color: Color(0x00000000),
backgroundBlendMode: BlendMode.difference,
);
expect(one == two, isFalse);
});
}
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