@@ -316,6 +316,7 @@ class FixedExtentMetrics extends FixedScrollMetrics {
316
316
required super .viewportDimension,
317
317
required super .axisDirection,
318
318
required this .itemIndex,
319
+ required super .devicePixelRatio,
319
320
});
320
321
321
322
@override
@@ -326,6 +327,7 @@ class FixedExtentMetrics extends FixedScrollMetrics {
326
327
double ? viewportDimension,
327
328
AxisDirection ? axisDirection,
328
329
int ? itemIndex,
330
+ double ? devicePixelRatio,
329
331
}) {
330
332
return FixedExtentMetrics (
331
333
minScrollExtent: minScrollExtent ?? (hasContentDimensions ? this .minScrollExtent : null ),
@@ -334,6 +336,7 @@ class FixedExtentMetrics extends FixedScrollMetrics {
334
336
viewportDimension: viewportDimension ?? (hasViewportDimension ? this .viewportDimension : null ),
335
337
axisDirection: axisDirection ?? this .axisDirection,
336
338
itemIndex: itemIndex ?? this .itemIndex,
339
+ devicePixelRatio: devicePixelRatio ?? this .devicePixelRatio,
337
340
);
338
341
}
339
342
@@ -399,6 +402,7 @@ class _FixedExtentScrollPosition extends ScrollPositionWithSingleContext impleme
399
402
double ? viewportDimension,
400
403
AxisDirection ? axisDirection,
401
404
int ? itemIndex,
405
+ double ? devicePixelRatio,
402
406
}) {
403
407
return FixedExtentMetrics (
404
408
minScrollExtent: minScrollExtent ?? (hasContentDimensions ? this .minScrollExtent : null ),
@@ -407,6 +411,7 @@ class _FixedExtentScrollPosition extends ScrollPositionWithSingleContext impleme
407
411
viewportDimension: viewportDimension ?? (hasViewportDimension ? this .viewportDimension : null ),
408
412
axisDirection: axisDirection ?? this .axisDirection,
409
413
itemIndex: itemIndex ?? this .itemIndex,
414
+ devicePixelRatio: devicePixelRatio ?? this .devicePixelRatio,
410
415
);
411
416
}
412
417
}
@@ -505,8 +510,8 @@ class FixedExtentScrollPhysics extends ScrollPhysics {
505
510
// Scenario 3:
506
511
// If there's no velocity and we're already at where we intend to land,
507
512
// do nothing.
508
- if (velocity.abs () < tolerance .velocity
509
- && (settlingPixels - metrics.pixels).abs () < tolerance .distance) {
513
+ if (velocity.abs () < toleranceFor (position) .velocity
514
+ && (settlingPixels - metrics.pixels).abs () < toleranceFor (position) .distance) {
510
515
return null ;
511
516
}
512
517
@@ -519,7 +524,7 @@ class FixedExtentScrollPhysics extends ScrollPhysics {
519
524
metrics.pixels,
520
525
settlingPixels,
521
526
velocity,
522
- tolerance: tolerance ,
527
+ tolerance: toleranceFor (position) ,
523
528
);
524
529
}
525
530
@@ -530,7 +535,7 @@ class FixedExtentScrollPhysics extends ScrollPhysics {
530
535
metrics.pixels,
531
536
settlingPixels,
532
537
velocity,
533
- tolerance .velocity * velocity.sign,
538
+ toleranceFor (position) .velocity * velocity.sign,
534
539
);
535
540
}
536
541
}
0 commit comments