opt refresh

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-02-23 16:45:14 +08:00
parent ee04978e0c
commit e88cd12dfa
2 changed files with 14 additions and 12 deletions

View File

@@ -301,10 +301,12 @@ class RefreshIndicatorState extends State<RefreshIndicator>
// If the notification.dragDetails is null, this scroll is not triggered by // If the notification.dragDetails is null, this scroll is not triggered by
// user dragging. It may be a result of ScrollController.jumpTo or ballistic scroll. // user dragging. It may be a result of ScrollController.jumpTo or ballistic scroll.
// In this case, we don't want to trigger the refresh indicator. // In this case, we don't want to trigger the refresh indicator.
return (notification is ScrollStartNotification && return _status == null &&
notification.dragDetails != null) && ((notification is ScrollStartNotification &&
notification.dragDetails != null) ||
(notification is ScrollUpdateNotification &&
notification.dragDetails != null)) &&
notification.metrics.extentBefore == 0.0 && notification.metrics.extentBefore == 0.0 &&
_status == null &&
_start(); _start();
} }
@@ -322,15 +324,15 @@ class RefreshIndicatorState extends State<RefreshIndicator>
if (_status == RefreshIndicatorStatus.drag) { if (_status == RefreshIndicatorStatus.drag) {
_dragOffset = _dragOffset! - notification.scrollDelta!; _dragOffset = _dragOffset! - notification.scrollDelta!;
_checkDragOffset(notification.metrics.viewportDimension); _checkDragOffset(notification.metrics.viewportDimension);
}
if (_status == RefreshIndicatorStatus.drag && if (notification.dragDetails == null &&
notification.dragDetails == null &&
_valueColor.value!.a == _effectiveValueColor.a) { _valueColor.value!.a == _effectiveValueColor.a) {
// On iOS start the refresh when the Scrollable bounces back from the // On iOS start the refresh when the Scrollable bounces back from the
// overscroll (ScrollNotification indicating this don't have dragDetails // overscroll (ScrollNotification indicating this don't have dragDetails
// because the scroll activity is not directly triggered by a drag). // because the scroll activity is not directly triggered by a drag).
_show(); _show();
} }
}
} else if (notification is OverscrollNotification) { } else if (notification is OverscrollNotification) {
if (_status == RefreshIndicatorStatus.drag) { if (_status == RefreshIndicatorStatus.drag) {
_dragOffset = _dragOffset! - notification.overscroll; _dragOffset = _dragOffset! - notification.overscroll;

View File

@@ -497,7 +497,7 @@ packages:
description: description:
path: "." path: "."
ref: mod ref: mod
resolved-ref: e05573ab132777bb7dc3a7a54af533c1ed4350b2 resolved-ref: e55d90cf2a1666e6ccf63e3f5779c8c4b12c5204
url: "https://github.com/bggRGjQaUbCoE/extended_nested_scroll_view.git" url: "https://github.com/bggRGjQaUbCoE/extended_nested_scroll_view.git"
source: git source: git
version: "6.2.1" version: "6.2.1"