Skip to content

Commit

Permalink
fix: IndicatorNotifier._onCanProcess. Null check operator used on a n…
Browse files Browse the repository at this point in the history
…ull value (#782), (#774).
  • Loading branch information
xuelongqy committed Nov 10, 2023
1 parent c5405fd commit c4024e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 3.3.2+3
- fix: IndicatorNotifier._onCanProcess. Null check operator used on a null value [#782](https://github.com/xuelongqy/flutter_easy_refresh/issues/782), [#774](https://github.com/xuelongqy/flutter_easy_refresh/issues/774).

## 3.3.2+2
- feat: All kind of pointer device are supported by default [#777](https://github.com/xuelongqy/flutter_easy_refresh/issues/777).

Expand Down
5 changes: 4 additions & 1 deletion lib/src/notifier/indicator_notifier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ abstract class IndicatorNotifier extends ChangeNotifier {
/// Can it be process.
CanProcessCallBack? _onCanProcess;

bool get _canProcess => _onCanProcess!.call();
bool get _canProcess => _onCanProcess?.call() ?? false;

/// Task completion result.
IndicatorResult _result = IndicatorResult.none;
Expand Down Expand Up @@ -429,6 +429,9 @@ abstract class IndicatorNotifier extends ChangeNotifier {
ScrollController? scrollController,
bool force = false,
}) {
if (_mounted) {
return Future.value();
}
if (!force) {
if (modeLocked || noMoreLocked || secondaryLocked || !_canProcess) {
return Future.value();
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: easy_refresh
description: A flutter widget that provides pull-down refresh and pull-up load.
version: 3.3.2+2
version: 3.3.2+3
homepage: https://xuelongqy.github.io/flutter_easy_refresh
repository: https://github.com/xuelongqy/flutter_easy_refresh
issue_tracker: https://github.com/xuelongqy/flutter_easy_refresh/issues
Expand Down

0 comments on commit c4024e6

Please sign in to comment.