opt scrollable gesture

Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
dom
2026-07-31 15:34:50 +08:00
parent 32fd0e4a76
commit 1ded09f246
52 changed files with 460 additions and 3172 deletions

View File

@@ -14,7 +14,6 @@ import 'package:PiliPlus/pages/video/controller.dart';
import 'package:PiliPlus/pages/video/post_panel/popup_menu_text.dart';
import 'package:PiliPlus/plugin/pl_player/controller.dart';
import 'package:PiliPlus/utils/duration_utils.dart';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:flutter/foundation.dart' show kDebugMode;
import 'package:flutter/material.dart';
import 'package:flutter/services.dart' show FilteringTextInputFormatter;
@@ -235,13 +234,11 @@ class _PostPanelState extends State<PostPanel>
}
late Key _key;
late bool _isNested;
@override
void didChangeDependencies() {
super.didChangeDependencies();
final controller = PrimaryScrollController.of(context);
_isNested = controller is ExtendedNestedScrollController;
_key = ValueKey(controller.hashCode);
}
@@ -251,25 +248,18 @@ class _PostPanelState extends State<PostPanel>
return scrollableError;
}
final bottom = MediaQuery.viewPaddingOf(context).bottom;
Widget child = ListView.builder(
key: _key,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 88 + bottom),
itemCount: list.length,
itemBuilder: (context, index) {
return _buildItem(theme, index, list[index]);
},
);
if (_isNested) {
child = ExtendedVisibilityDetector(
uniqueKey: const ValueKey(PostPanel),
child: child,
);
}
return Stack(
clipBehavior: Clip.none,
children: [
child,
ListView.builder(
key: _key,
physics: const AlwaysScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 88 + bottom),
itemCount: list.length,
itemBuilder: (context, index) {
return _buildItem(theme, index, list[index]);
},
),
Positioned(
right: kFloatingActionButtonMargin,
bottom: kFloatingActionButtonMargin + bottom,