Fill in SliverConstraints fields missing from ==, hashCode, toString (#143661)
I was doing some debugging on a RenderSliver subclass, and found that SliverConstraints.toString was missing the precedingScrollExtent field. Add that, and add both that field and userScrollDirection to the `==` and hashCode implementations, which had been skipping them, so that all three methods now handle all the class's fields.
This commit is contained in:
@@ -556,7 +556,9 @@ class SliverConstraints extends Constraints {
|
||||
assert(other.debugAssertIsValid());
|
||||
return other.axisDirection == axisDirection
|
||||
&& other.growthDirection == growthDirection
|
||||
&& other.userScrollDirection == userScrollDirection
|
||||
&& other.scrollOffset == scrollOffset
|
||||
&& other.precedingScrollExtent == precedingScrollExtent
|
||||
&& other.overlap == overlap
|
||||
&& other.remainingPaintExtent == remainingPaintExtent
|
||||
&& other.crossAxisExtent == crossAxisExtent
|
||||
@@ -570,7 +572,9 @@ class SliverConstraints extends Constraints {
|
||||
int get hashCode => Object.hash(
|
||||
axisDirection,
|
||||
growthDirection,
|
||||
userScrollDirection,
|
||||
scrollOffset,
|
||||
precedingScrollExtent,
|
||||
overlap,
|
||||
remainingPaintExtent,
|
||||
crossAxisExtent,
|
||||
@@ -587,6 +591,7 @@ class SliverConstraints extends Constraints {
|
||||
'$growthDirection',
|
||||
'$userScrollDirection',
|
||||
'scrollOffset: ${scrollOffset.toStringAsFixed(1)}',
|
||||
'precedingScrollExtent: ${precedingScrollExtent.toStringAsFixed(1)}',
|
||||
'remainingPaintExtent: ${remainingPaintExtent.toStringAsFixed(1)}',
|
||||
if (overlap != 0.0) 'overlap: ${overlap.toStringAsFixed(1)}',
|
||||
'crossAxisExtent: ${crossAxisExtent.toStringAsFixed(1)}',
|
||||
|
||||
Reference in New Issue
Block a user