Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
9ef81927
Unverified
Commit
9ef81927
authored
Jul 16, 2020
by
Bogdan Lukin
Committed by
GitHub
Jul 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix/decoration equality (#61551)
parent
63ceeb8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
4 deletions
+36
-4
box_decoration.dart
packages/flutter/lib/src/painting/box_decoration.dart
+2
-2
shape_decoration.dart
packages/flutter/lib/src/painting/shape_decoration.dart
+2
-2
decoration_test.dart
packages/flutter/test/painting/decoration_test.dart
+15
-0
shape_decoration_test.dart
packages/flutter/test/widgets/shape_decoration_test.dart
+17
-0
No files found.
packages/flutter/lib/src/painting/box_decoration.dart
View file @
9ef81927
...
...
@@ -321,7 +321,7 @@ class BoxDecoration extends Decoration {
&&
other
.
image
==
image
&&
other
.
border
==
border
&&
other
.
borderRadius
==
borderRadius
&&
other
.
boxShadow
==
boxShadow
&&
listEquals
<
BoxShadow
>(
other
.
boxShadow
,
boxShadow
)
&&
other
.
gradient
==
gradient
&&
other
.
shape
==
shape
;
}
...
...
@@ -333,7 +333,7 @@ class BoxDecoration extends Decoration {
image
,
border
,
borderRadius
,
boxShadow
,
hashList
(
boxShadow
)
,
gradient
,
shape
,
);
...
...
packages/flutter/lib/src/painting/shape_decoration.dart
View file @
9ef81927
...
...
@@ -257,7 +257,7 @@ class ShapeDecoration extends Decoration {
&&
other
.
color
==
color
&&
other
.
gradient
==
gradient
&&
other
.
image
==
image
&&
other
.
shadows
==
shadows
&&
listEquals
<
BoxShadow
>(
other
.
shadows
,
shadows
)
&&
other
.
shape
==
shape
;
}
...
...
@@ -268,7 +268,7 @@ class ShapeDecoration extends Decoration {
gradient
,
image
,
shape
,
shadows
,
hashList
(
shadows
)
,
);
}
...
...
packages/flutter/test/painting/decoration_test.dart
View file @
9ef81927
...
...
@@ -126,6 +126,21 @@ void main() {
expect
(
c
.
color
,
equals
(
b
.
color
));
});
test
(
'Decoration equality'
,
()
{
const
BoxDecoration
a
=
BoxDecoration
(
color:
Color
(
0xFFFFFFFF
),
boxShadow:
<
BoxShadow
>[
BoxShadow
()],
);
const
BoxDecoration
b
=
BoxDecoration
(
color:
Color
(
0xFFFFFFFF
),
boxShadow:
<
BoxShadow
>[
BoxShadow
()],
);
expect
(
a
.
hashCode
,
equals
(
b
.
hashCode
));
expect
(
a
,
equals
(
b
));
});
test
(
'BoxDecorationImageListenerSync'
,
()
{
final
ImageProvider
imageProvider
=
SynchronousTestImageProvider
();
final
DecorationImage
backgroundImage
=
DecorationImage
(
image:
imageProvider
);
...
...
packages/flutter/test/widgets/shape_decoration_test.dart
View file @
9ef81927
...
...
@@ -115,4 +115,21 @@ Future<void> main() async {
],
);
});
test
(
'ShapeDecoration equality'
,
()
{
const
ShapeDecoration
a
=
ShapeDecoration
(
color:
Color
(
0xFFFFFFFF
),
shadows:
<
BoxShadow
>[
BoxShadow
()],
shape:
Border
(),
);
const
ShapeDecoration
b
=
ShapeDecoration
(
color:
Color
(
0xFFFFFFFF
),
shadows:
<
BoxShadow
>[
BoxShadow
()],
shape:
Border
(),
);
expect
(
a
.
hashCode
,
equals
(
b
.
hashCode
));
expect
(
a
,
equals
(
b
));
});
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment