mirror of
https://github.com/flutter/flutter
synced 2024-09-12 21:01:59 +00:00
Fix typo in SliverLayoutDimensions.hashCode
where not all properties are used in the hash code. (#150306)
https://github.com/flutter/flutter/issues/150305 fix typo in `SliverLayoutDimensions.hashCode` where not all properties are used in the hash code.
This commit is contained in:
parent
cf375f0dfb
commit
c1a6a631fd
|
@ -80,7 +80,7 @@ class SliverLayoutDimensions {
|
|||
scrollOffset,
|
||||
precedingScrollExtent,
|
||||
viewportMainAxisExtent,
|
||||
viewportMainAxisExtent
|
||||
crossAxisExtent,
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -1019,6 +1019,25 @@ void main() {
|
|||
}
|
||||
expect(threw, true);
|
||||
});
|
||||
|
||||
// Regression test for https://github.com/flutter/flutter/issues/150305
|
||||
test('SliverLayoutDimensions has correct hashCode', () {
|
||||
const SliverLayoutDimensions dimensions = SliverLayoutDimensions(
|
||||
scrollOffset: 1.0,
|
||||
precedingScrollExtent: 2.0,
|
||||
viewportMainAxisExtent: 3.0,
|
||||
crossAxisExtent: 4.0,
|
||||
);
|
||||
expect(
|
||||
dimensions.hashCode,
|
||||
Object.hash(
|
||||
dimensions.scrollOffset,
|
||||
dimensions.precedingScrollExtent,
|
||||
dimensions.viewportMainAxisExtent,
|
||||
dimensions.crossAxisExtent,
|
||||
),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
class _DummyHitTestTarget implements HitTestTarget {
|
||||
|
|
Loading…
Reference in a new issue