Skip to content

Commit

Permalink
Fix: Replace Deprecated Tolerance (#118)
Browse files Browse the repository at this point in the history
* fix tolerance to toleranceFor

* update version and changelog
  • Loading branch information
MayLau-CbL committed Jun 17, 2023
1 parent b30b9c9 commit b07e8a3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,6 @@
## [4.3.1] - 20230617
* Fix: replace deprecated tolerance with toleranceFor

## [4.3.0+1] - 20230617
* Fix: web and android example

Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Expand Up @@ -44,7 +44,7 @@ packages:
path: ".."
relative: true
source: path
version: "4.3.0"
version: "4.3.1"
http:
dependency: "direct main"
description:
Expand Down
16 changes: 15 additions & 1 deletion lib/refresh/pull_to_refresh/src/internals/refresh_physics.dart
Expand Up @@ -281,6 +281,9 @@ class RefreshPhysics extends ScrollPhysics {
if ((position.pixels > 0 &&
controller!.headerMode!.value == RefreshStatus.twoLeveling) ||
position.outOfRange) {
BuildContext? scrollViewContext =
controller!.position?.context.storageContext;

return BouncingScrollSimulation(
spring: springDescription ?? spring,
position: position.pixels,
Expand All @@ -292,7 +295,18 @@ class RefreshPhysics extends ScrollPhysics {
controller!.headerMode!.value == RefreshStatus.twoLeveling
? 0.0
: position.maxScrollExtent,
tolerance: tolerance,
tolerance: toleranceFor(
FixedScrollMetrics(
minScrollExtent: null,
maxScrollExtent: null,
pixels: null,
viewportDimension: null,
axisDirection: AxisDirection.down,
devicePixelRatio: scrollViewContext == null
? 1.0
: View.of(scrollViewContext).devicePixelRatio,
),
),
);
}
return super.createBallisticSimulation(position, velocity);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
@@ -1,6 +1,6 @@
name: horizontal_data_table
description: A horizontal data table with a fixed column on left handside.
version: 4.3.0+1
version: 4.3.1
author: May Lau<may.lau.dev@gmail.com>
homepage: https://github.com/MayLau-CbL/flutter_horizontal_data_table

Expand Down

0 comments on commit b07e8a3

Please sign in to comment.