mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
@@ -11,9 +11,13 @@ $ToolTipFix = "56956c33ef102ac0b5fc46b62bd2dd9f50a86616";
|
|||||||
$NewOverScrollIndicator = "362b1de29974ffc1ed6faa826e1df870d7bec75f";
|
$NewOverScrollIndicator = "362b1de29974ffc1ed6faa826e1df870d7bec75f";
|
||||||
|
|
||||||
$BottomSheetPatch = "lib/scripts/bottom_sheet.patch"
|
$BottomSheetPatch = "lib/scripts/bottom_sheet.patch"
|
||||||
|
|
||||||
|
$ScrollViewPatch = "lib/scripts/scroll_view.patch"
|
||||||
|
|
||||||
# TODO: remove
|
# TODO: remove
|
||||||
# https://github.com/flutter/flutter/issues/90223
|
# https://github.com/flutter/flutter/issues/90223
|
||||||
$ModalBarrierPatch = "lib/scripts/modal_barrier.patch"
|
$ModalBarrierPatch = "lib/scripts/modal_barrier.patch"
|
||||||
|
|
||||||
# TODO: remove
|
# TODO: remove
|
||||||
# https://github.com/flutter/flutter/issues/182466
|
# https://github.com/flutter/flutter/issues/182466
|
||||||
$MouseCursorPatch = "lib/scripts/mouse_cursor.patch"
|
$MouseCursorPatch = "lib/scripts/mouse_cursor.patch"
|
||||||
@@ -28,8 +32,11 @@ switch ($platform.ToLower()) {
|
|||||||
"android" {
|
"android" {
|
||||||
$reverts += $NewOverScrollIndicator
|
$reverts += $NewOverScrollIndicator
|
||||||
$patches += $BottomSheetPatch
|
$patches += $BottomSheetPatch
|
||||||
|
$patches += $ScrollViewPatch
|
||||||
|
}
|
||||||
|
"ios" {
|
||||||
|
$patches += $ScrollViewPatch
|
||||||
}
|
}
|
||||||
"ios" {}
|
|
||||||
"linux" {
|
"linux" {
|
||||||
$picks += $ToolTipFix
|
$picks += $ToolTipFix
|
||||||
}
|
}
|
||||||
|
|||||||
73
lib/scripts/scroll_view.patch
Normal file
73
lib/scripts/scroll_view.patch
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart
|
||||||
|
index ac854f7de8f..fdeba1a88f5 100644
|
||||||
|
--- a/packages/flutter/lib/src/widgets/scrollable.dart
|
||||||
|
+++ b/packages/flutter/lib/src/widgets/scrollable.dart
|
||||||
|
@@ -786,11 +786,13 @@ class ScrollableState extends State<Scrollable>
|
||||||
|
switch (widget.axis) {
|
||||||
|
case Axis.vertical:
|
||||||
|
_gestureRecognizers = <Type, GestureRecognizerFactory>{
|
||||||
|
- VerticalDragGestureRecognizer:
|
||||||
|
- GestureRecognizerFactoryWithHandlers<VerticalDragGestureRecognizer>(
|
||||||
|
- () => VerticalDragGestureRecognizer(supportedDevices: _configuration.dragDevices),
|
||||||
|
- (VerticalDragGestureRecognizer instance) {
|
||||||
|
+ _VerticalDragGestureRecognizer:
|
||||||
|
+ GestureRecognizerFactoryWithHandlers<_VerticalDragGestureRecognizer>(
|
||||||
|
+ () =>
|
||||||
|
+ _VerticalDragGestureRecognizer(supportedDevices: _configuration.dragDevices),
|
||||||
|
+ (_VerticalDragGestureRecognizer instance) {
|
||||||
|
instance
|
||||||
|
+ ..isDyAllowed = _isDyAllowed
|
||||||
|
..onDown = _handleDragDown
|
||||||
|
..onStart = _handleDragStart
|
||||||
|
..onUpdate = _handleDragUpdate
|
||||||
|
@@ -859,6 +861,10 @@ class ScrollableState extends State<Scrollable>
|
||||||
|
Drag? _drag;
|
||||||
|
ScrollHoldController? _hold;
|
||||||
|
|
||||||
|
+ bool _isDyAllowed(double dy) {
|
||||||
|
+ return position.viewportDimension - dy > 30;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
void _handleDragDown(DragDownDetails details) {
|
||||||
|
assert(_drag == null);
|
||||||
|
assert(_hold == null);
|
||||||
|
@@ -2553,3 +2559,39 @@ class _HorizontalInnerDimensionState extends ScrollableState {
|
||||||
|
return _configuration.buildOverscrollIndicator(context, child, details);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+typedef IsDyAllowed = bool Function(double dy);
|
||||||
|
+
|
||||||
|
+class _VerticalDragGestureRecognizer extends VerticalDragGestureRecognizer {
|
||||||
|
+ _VerticalDragGestureRecognizer({
|
||||||
|
+ super.debugOwner,
|
||||||
|
+ super.supportedDevices,
|
||||||
|
+ super.allowedButtonsFilter,
|
||||||
|
+ });
|
||||||
|
+
|
||||||
|
+ IsDyAllowed? isDyAllowed;
|
||||||
|
+
|
||||||
|
+ bool _isDyAllowed = true;
|
||||||
|
+
|
||||||
|
+ @override
|
||||||
|
+ bool isPointerAllowed(PointerEvent event) {
|
||||||
|
+ _isDyAllowed = isDyAllowed?.call(event.localPosition.dy) ?? true;
|
||||||
|
+ return super.isPointerAllowed(event);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @override
|
||||||
|
+ T? invokeCallback<T>(
|
||||||
|
+ String name,
|
||||||
|
+ RecognizerCallback<T> callback, {
|
||||||
|
+ String Function()? debugReport,
|
||||||
|
+ }) {
|
||||||
|
+ if (!_isDyAllowed) return null;
|
||||||
|
+ return super.invokeCallback(name, callback, debugReport: debugReport);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ @override
|
||||||
|
+ void dispose() {
|
||||||
|
+ isDyAllowed = null;
|
||||||
|
+ super.dispose();
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
Reference in New Issue
Block a user