opt gesture

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-01-23 11:46:16 +08:00
parent 310f497c30
commit bd158619a4
17 changed files with 407 additions and 396 deletions

View File

@@ -4,9 +4,11 @@
import 'dart:ui' show SemanticsRole;
import 'package:PiliPlus/common/widgets/flutter/page/page_view.dart';
import 'package:PiliPlus/common/widgets/gesture/horizontal_drag_gesture_recognizer.dart';
import 'package:flutter/foundation.dart' show clampDouble;
import 'package:flutter/gestures.dart' show DragStartBehavior;
import 'package:flutter/material.dart' hide TabBarView;
import 'package:flutter/material.dart' hide TabBarView, PageView;
/// A page view that displays the widget which corresponds to the currently
/// selected tab.
@@ -355,7 +357,7 @@ class _CustomTabBarViewState extends State<CustomTabBarView> {
return NotificationListener<ScrollNotification>(
onNotification: _handleScrollNotification,
child: PageView(
child: PageView<CustomHorizontalDragGestureRecognizer>(
scrollDirection: widget.scrollDirection,
dragStartBehavior: widget.dragStartBehavior,
clipBehavior: widget.clipBehavior,
@@ -363,6 +365,8 @@ class _CustomTabBarViewState extends State<CustomTabBarView> {
physics: widget.physics == null
? const PageScrollPhysics().applyTo(const ClampingScrollPhysics())
: const PageScrollPhysics().applyTo(widget.physics),
horizontalDragGestureRecognizer:
CustomHorizontalDragGestureRecognizer(),
children: _childrenWithKey,
),
);