Skip to content

Commit

Permalink
breaking: Flutter >=3.7.0, dart >=2.19.0
Browse files Browse the repository at this point in the history
  • Loading branch information
xuelongqy committed Apr 26, 2024
1 parent c7da37b commit d6a2bea
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 15 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Next
- breaking: Flutter >=3.7.0, dart >=2.19.0. Remove some unnecessary compatibility, please update the Flutter version in time, or use the previous version.

## 3.3.5+1
- fix: Indicator properties cannot be updated [#818](https://github.com/xuelongqy/flutter_easy_refresh/issues/818).

Expand Down
4 changes: 2 additions & 2 deletions lib/src/notifier/indicator_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ class HeaderNotifier extends IndicatorNotifier {
velocity: mVelocity,
leadingExtent: position.minScrollExtent - overExtent,
trailingExtent: 0,
tolerance: _physics.getTolerance(position),
tolerance: _physics.toleranceFor(position),
);
}
return null;
Expand Down Expand Up @@ -1176,7 +1176,7 @@ class FooterNotifier extends IndicatorNotifier {
velocity: mVelocity,
leadingExtent: 0,
trailingExtent: position.maxScrollExtent + overExtent,
tolerance: _physics.getTolerance(position),
tolerance: _physics.toleranceFor(position),
);
}
return null;
Expand Down
12 changes: 1 addition & 11 deletions lib/src/physics/scroll_physics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -421,20 +421,10 @@ class _ERScrollPhysics extends BouncingScrollPhysics {
footerNotifier._updateOffset(position, hClamping ? 0 : offset, false);
}

/// The tolerance to use for ballistic simulations.
Tolerance getTolerance(ScrollMetrics metrics) {
try {
// This feature after v3.7.0-13.0.pre.
return (this as dynamic).toleranceFor(metrics);
} catch (_) {
return this.tolerance;
}
}

@override
Simulation? createBallisticSimulation(
ScrollMetrics position, double velocity) {
Tolerance tolerance = getTolerance(position);
Tolerance tolerance = toleranceFor(position);
// User stopped scrolling.
final oldUserOffset = userOffsetNotifier.value;
userOffsetNotifier.value = false;
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ repository: https://github.com/xuelongqy/flutter_easy_refresh
issue_tracker: https://github.com/xuelongqy/flutter_easy_refresh/issues

environment:
sdk: ">=2.13.0 <4.0.0"
flutter: ">=1.24.0"
sdk: ">=2.19.0"
flutter: ">=3.7.0"

dependencies:
flutter:
Expand Down

0 comments on commit d6a2bea

Please sign in to comment.