mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-10 13:04:50 +08:00
@@ -114,7 +114,7 @@ class PageView<T extends HorizontalDragGestureRecognizer>
|
||||
required this.horizontalDragGestureRecognizer,
|
||||
}) : childrenDelegate = SliverChildListDelegate(children);
|
||||
|
||||
final T horizontalDragGestureRecognizer;
|
||||
final GestureRecognizerFactoryConstructor<T> horizontalDragGestureRecognizer;
|
||||
|
||||
/// Creates a scrollable list that works page by page using widgets that are
|
||||
/// created on demand.
|
||||
|
||||
@@ -105,7 +105,7 @@ class Scrollable<T extends HorizontalDragGestureRecognizer>
|
||||
required this.horizontalDragGestureRecognizer,
|
||||
}) : assert(semanticChildCount == null || semanticChildCount >= 0);
|
||||
|
||||
final T horizontalDragGestureRecognizer;
|
||||
final GestureRecognizerFactoryConstructor<T> horizontalDragGestureRecognizer;
|
||||
|
||||
/// {@template flutter.widgets.Scrollable.axisDirection}
|
||||
/// The direction in which this widget scrolls.
|
||||
@@ -815,7 +815,7 @@ class ScrollableState<T extends HorizontalDragGestureRecognizer>
|
||||
case Axis.horizontal:
|
||||
_gestureRecognizers = <Type, GestureRecognizerFactory>{
|
||||
T: GestureRecognizerFactoryWithHandlers<T>(
|
||||
() => widget.horizontalDragGestureRecognizer,
|
||||
widget.horizontalDragGestureRecognizer,
|
||||
(T instance) {
|
||||
instance
|
||||
..onDown = _handleDragDown
|
||||
|
||||
@@ -38,7 +38,7 @@ class TabBarView<T extends HorizontalDragGestureRecognizer>
|
||||
required this.horizontalDragGestureRecognizer,
|
||||
});
|
||||
|
||||
final T horizontalDragGestureRecognizer;
|
||||
final GestureRecognizerFactoryConstructor<T> horizontalDragGestureRecognizer;
|
||||
|
||||
/// This widget's selection and animation state.
|
||||
///
|
||||
|
||||
@@ -87,11 +87,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
late final _tween = Matrix4Tween();
|
||||
late final _animatable = _tween.chain(CurveTween(curve: Curves.easeOut));
|
||||
|
||||
late final _horizontalDragGestureRecognizer =
|
||||
ImageHorizontalDragGestureRecognizer(
|
||||
width: 0,
|
||||
transformationController: _transformationController,
|
||||
);
|
||||
late final _horizontalDragGestureRecognizer;
|
||||
|
||||
late Offset _doubleTapLocalPosition;
|
||||
|
||||
@@ -111,6 +107,11 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
|
||||
_transformationController = TransformationController();
|
||||
|
||||
_horizontalDragGestureRecognizer = ImageHorizontalDragGestureRecognizer(
|
||||
width: 0,
|
||||
transformationController: _transformationController,
|
||||
);
|
||||
|
||||
_animationController = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
@@ -246,7 +247,8 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
|
||||
: _itemBuilder(index, item),
|
||||
);
|
||||
},
|
||||
horizontalDragGestureRecognizer: _horizontalDragGestureRecognizer,
|
||||
horizontalDragGestureRecognizer: () =>
|
||||
_horizontalDragGestureRecognizer,
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
|
||||
@@ -9,7 +9,7 @@ Widget videoTabBarView({
|
||||
}) => TabBarView<CustomHorizontalDragGestureRecognizer>(
|
||||
controller: controller,
|
||||
physics: const CustomTabBarViewScrollPhysics(parent: ClampingScrollPhysics()),
|
||||
horizontalDragGestureRecognizer: CustomHorizontalDragGestureRecognizer(),
|
||||
horizontalDragGestureRecognizer: CustomHorizontalDragGestureRecognizer.new,
|
||||
children: children,
|
||||
);
|
||||
|
||||
@@ -19,7 +19,7 @@ Widget tabBarView({
|
||||
}) => TabBarView<CustomHorizontalDragGestureRecognizer>(
|
||||
physics: const CustomTabBarViewScrollPhysics(),
|
||||
controller: controller,
|
||||
horizontalDragGestureRecognizer: CustomHorizontalDragGestureRecognizer(),
|
||||
horizontalDragGestureRecognizer: CustomHorizontalDragGestureRecognizer.new,
|
||||
children: children,
|
||||
);
|
||||
|
||||
|
||||
@@ -24,6 +24,13 @@ mixin CommonSlideMixin<T extends CommonSlidePage> on State<T>, TickerProvider {
|
||||
|
||||
static bool slideDismissReplyPage = Pref.slideDismissReplyPage;
|
||||
|
||||
bool isDxAllowed(double dx) {
|
||||
return enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true;
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
@@ -235,12 +235,8 @@ class _EpisodePanelState extends State<EpisodePanel>
|
||||
if (_isMulti) {
|
||||
return TabBarView<TabBarDragGestureRecognizer>(
|
||||
controller: _tabController,
|
||||
horizontalDragGestureRecognizer: TabBarDragGestureRecognizer(
|
||||
isDxAllowed: (double dx) => enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true,
|
||||
),
|
||||
horizontalDragGestureRecognizer: () =>
|
||||
TabBarDragGestureRecognizer(isDxAllowed: isDxAllowed),
|
||||
children: List.generate(
|
||||
widget.list.length,
|
||||
(index) => _buildBody(
|
||||
|
||||
@@ -139,7 +139,7 @@ class _HistoryPageState extends State<HistoryPage>
|
||||
: const CustomTabBarViewScrollPhysics(),
|
||||
controller: _historyController.tabController,
|
||||
horizontalDragGestureRecognizer:
|
||||
CustomHorizontalDragGestureRecognizer(),
|
||||
CustomHorizontalDragGestureRecognizer.new,
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => child),
|
||||
..._historyController.tabs.map(
|
||||
|
||||
@@ -135,7 +135,7 @@ class _LaterPageState extends State<LaterPage>
|
||||
: const CustomTabBarViewScrollPhysics(),
|
||||
controller: _tabController,
|
||||
horizontalDragGestureRecognizer:
|
||||
CustomHorizontalDragGestureRecognizer(),
|
||||
CustomHorizontalDragGestureRecognizer.new,
|
||||
children: LaterViewType.values
|
||||
.map((item) => item.page)
|
||||
.toList(),
|
||||
|
||||
@@ -733,7 +733,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
onPageChanged: (value) =>
|
||||
_liveRoomController.pageIndex.value = value,
|
||||
horizontalDragGestureRecognizer:
|
||||
CustomHorizontalDragGestureRecognizer(),
|
||||
CustomHorizontalDragGestureRecognizer.new,
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => chat()),
|
||||
SuperChatPanel(
|
||||
|
||||
@@ -97,12 +97,8 @@ class _IntroDetailState extends State<PgcIntroPanel>
|
||||
return TabBarView<TabBarDragGestureRecognizer>(
|
||||
controller: _tabController,
|
||||
physics: const CustomTabBarViewScrollPhysics(),
|
||||
horizontalDragGestureRecognizer: TabBarDragGestureRecognizer(
|
||||
isDxAllowed: (double dx) => enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true,
|
||||
),
|
||||
horizontalDragGestureRecognizer: () =>
|
||||
TabBarDragGestureRecognizer(isDxAllowed: isDxAllowed),
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => _buildInfo(theme)),
|
||||
PgcReviewPage(
|
||||
|
||||
Reference in New Issue
Block a user