Consider backgroundBlendMode in equality of BoxDecoration (#100788)
This commit is contained in:
committed by
GitHub
parent
ef8e3578c1
commit
7eeafb1287
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user