reapply RangeMaintainingScrollPhysics

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-06-23 12:26:08 +08:00
parent 8c6794af0d
commit cc205bd7c6
2 changed files with 1 additions and 16 deletions

View File

@@ -551,7 +551,7 @@ class RefreshIndicatorState extends State<RefreshIndicator>
return ScrollConfiguration( return ScrollConfiguration(
behavior: RefreshScrollBehavior( behavior: RefreshScrollBehavior(
scrollPhysics: RefreshScrollPhysics( scrollPhysics: RefreshScrollPhysics(
// parent: const RangeMaintainingScrollPhysics(), parent: const RangeMaintainingScrollPhysics(),
onDrag: _onDrag, onDrag: _onDrag,
), ),
), ),

View File

@@ -3,10 +3,6 @@ import 'dart:io' show Platform;
import 'package:flutter/gestures.dart' show PointerDeviceKind; import 'package:flutter/gestures.dart' show PointerDeviceKind;
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
const _clampingPhysics = ClampingScrollPhysics();
const _bouncingPhysics = BouncingScrollPhysics();
const _bouncingDesktopPhysics = BouncingScrollPhysics(decelerationRate: .fast);
class CustomScrollBehavior extends MaterialScrollBehavior { class CustomScrollBehavior extends MaterialScrollBehavior {
const CustomScrollBehavior(); const CustomScrollBehavior();
@@ -33,17 +29,6 @@ class CustomScrollBehavior extends MaterialScrollBehavior {
return child; return child;
} }
@override
ScrollPhysics getScrollPhysics(BuildContext context) {
if (Platform.isIOS) {
return _bouncingPhysics;
}
if (Platform.isMacOS) {
return _bouncingDesktopPhysics;
}
return _clampingPhysics;
}
@override @override
Set<PointerDeviceKind> get dragDevices => desktopDragDevices; Set<PointerDeviceKind> get dragDevices => desktopDragDevices;
} }