mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-24 03:00:13 +08:00
reapply RangeMaintainingScrollPhysics
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -551,7 +551,7 @@ class RefreshIndicatorState extends State<RefreshIndicator>
|
||||
return ScrollConfiguration(
|
||||
behavior: RefreshScrollBehavior(
|
||||
scrollPhysics: RefreshScrollPhysics(
|
||||
// parent: const RangeMaintainingScrollPhysics(),
|
||||
parent: const RangeMaintainingScrollPhysics(),
|
||||
onDrag: _onDrag,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -3,10 +3,6 @@ import 'dart:io' show Platform;
|
||||
import 'package:flutter/gestures.dart' show PointerDeviceKind;
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const _clampingPhysics = ClampingScrollPhysics();
|
||||
const _bouncingPhysics = BouncingScrollPhysics();
|
||||
const _bouncingDesktopPhysics = BouncingScrollPhysics(decelerationRate: .fast);
|
||||
|
||||
class CustomScrollBehavior extends MaterialScrollBehavior {
|
||||
const CustomScrollBehavior();
|
||||
|
||||
@@ -33,17 +29,6 @@ class CustomScrollBehavior extends MaterialScrollBehavior {
|
||||
return child;
|
||||
}
|
||||
|
||||
@override
|
||||
ScrollPhysics getScrollPhysics(BuildContext context) {
|
||||
if (Platform.isIOS) {
|
||||
return _bouncingPhysics;
|
||||
}
|
||||
if (Platform.isMacOS) {
|
||||
return _bouncingDesktopPhysics;
|
||||
}
|
||||
return _clampingPhysics;
|
||||
}
|
||||
|
||||
@override
|
||||
Set<PointerDeviceKind> get dragDevices => desktopDragDevices;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user