Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-27 15:48:16 +08:00
parent 6a9795f561
commit 29c47cee78
5 changed files with 140 additions and 8 deletions

View File

@@ -22,6 +22,7 @@ import 'package:PiliPlus/pages/search/widgets/search_text.dart';
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
import 'package:PiliPlus/pages/video/detail/related/controller.dart';
import 'package:PiliPlus/pages/video/detail/reply/controller.dart';
import 'package:PiliPlus/pages/video/detail/view_v.dart' show ViewPointsPage;
import 'package:PiliPlus/pages/video/detail/widgets/send_danmaku_panel.dart';
import 'package:PiliPlus/pages/video/detail/widgets/watch_later_list.dart';
import 'package:PiliPlus/utils/extension.dart';
@@ -1329,8 +1330,10 @@ class VideoDetailController extends GetxController
} else {
childKey.currentState?.showBottomSheet(
enableDrag: false,
(context) => _postPanel(),
backgroundColor: Colors.transparent,
(context) => ViewPointsPage(
child: _postPanel(),
),
);
}
}
@@ -1496,6 +1499,8 @@ class VideoDetailController extends GetxController
? Stack(
children: [
SingleChildScrollView(
controller: ScrollController(),
physics: const AlwaysScrollableScrollPhysics(),
child: Column(
children: [
...List.generate(

View File

@@ -107,7 +107,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
? null
: _videoReplyController.scrollController,
physics: widget.needController == false
? const NeverScrollableScrollPhysics(
? const AlwaysScrollableScrollPhysics(
parent: ClampingScrollPhysics(),
)
: const AlwaysScrollableScrollPhysics(),

View File

@@ -1796,13 +1796,13 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
);
Widget videoIntro([bool needRelated = true, bool needCtr = true]) {
Widget introPanel() => Material(
color: Colors.transparent,
child: CustomScrollView(
Widget introPanel() => Scaffold(
backgroundColor: Colors.transparent,
body: CustomScrollView(
key: const PageStorageKey<String>('简介'),
controller: needCtr ? _introController : null,
physics: needCtr.not
? const NeverScrollableScrollPhysics(
? const AlwaysScrollableScrollPhysics(
parent: ClampingScrollPhysics(),
)
: null,
@@ -2260,6 +2260,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
],
),
body: SingleChildScrollView(
controller: ScrollController(),
physics: const AlwaysScrollableScrollPhysics(),
child: Column(
children: [
...List.generate(
@@ -2358,7 +2360,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
} else {
videoDetailController.childKey.currentState?.showBottomSheet(
backgroundColor: Colors.transparent,
(context) => listSheetContent(),
(context) => ViewPointsPage(
child: listSheetContent(),
),
);
}
}
@@ -2391,3 +2395,35 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
);
}
}
class ViewPointsPage extends StatefulWidget {
const ViewPointsPage({super.key, required this.child});
final Widget child;
@override
State<ViewPointsPage> createState() => _ViewPointsPageState();
}
class _ViewPointsPageState extends State<ViewPointsPage> {
bool _isInit = true;
@override
void initState() {
super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) {
setState(() {
_isInit = false;
});
});
}
@override
Widget build(BuildContext context) {
return _isInit
? CustomScrollView(
physics: const NeverScrollableScrollPhysics(),
)
: widget.child;
}
}