Skip to content

Commit c1a6a63

Browse files
Fix typo in SliverLayoutDimensions.hashCode where not all properties are used in the hash code. (#150306)
flutter/flutter#150305 fix typo in `SliverLayoutDimensions.hashCode` where not all properties are used in the hash code.
1 parent cf375f0 commit c1a6a63

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

packages/flutter/lib/src/rendering/sliver.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class SliverLayoutDimensions {
8080
scrollOffset,
8181
precedingScrollExtent,
8282
viewportMainAxisExtent,
83-
viewportMainAxisExtent
83+
crossAxisExtent,
8484
);
8585
}
8686

packages/flutter/test/rendering/slivers_test.dart

+19
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,25 @@ void main() {
10191019
}
10201020
expect(threw, true);
10211021
});
1022+
1023+
// Regression test for https://github.com/flutter/flutter/issues/150305
1024+
test('SliverLayoutDimensions has correct hashCode', () {
1025+
const SliverLayoutDimensions dimensions = SliverLayoutDimensions(
1026+
scrollOffset: 1.0,
1027+
precedingScrollExtent: 2.0,
1028+
viewportMainAxisExtent: 3.0,
1029+
crossAxisExtent: 4.0,
1030+
);
1031+
expect(
1032+
dimensions.hashCode,
1033+
Object.hash(
1034+
dimensions.scrollOffset,
1035+
dimensions.precedingScrollExtent,
1036+
dimensions.viewportMainAxisExtent,
1037+
dimensions.crossAxisExtent,
1038+
),
1039+
);
1040+
});
10221041
}
10231042

10241043
class _DummyHitTestTarget implements HitTestTarget {

0 commit comments

Comments
 (0)