mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 19:14:42 +08:00
@@ -21,7 +21,7 @@ class PgcIntroPanel extends CommonSlidePage {
|
||||
const PgcIntroPanel({
|
||||
super.key,
|
||||
required this.item,
|
||||
super.enableSlide = false,
|
||||
super.enableSlide,
|
||||
this.videoTags,
|
||||
});
|
||||
|
||||
@@ -50,42 +50,61 @@ class _IntroDetailState extends State<PgcIntroPanel>
|
||||
|
||||
@override
|
||||
Widget buildPage(ThemeData theme) {
|
||||
return CustomTabBarView(
|
||||
controller: _tabController,
|
||||
physics: const CustomTabBarViewScrollPhysics(),
|
||||
bgColor: theme.colorScheme.surface,
|
||||
header: Row(
|
||||
return Material(
|
||||
color: theme.colorScheme.surface,
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: TabBar(
|
||||
controller: _tabController,
|
||||
dividerHeight: 0,
|
||||
isScrollable: true,
|
||||
tabAlignment: TabAlignment.start,
|
||||
dividerColor: Colors.transparent,
|
||||
tabs: const [
|
||||
Tab(text: '详情'),
|
||||
Tab(text: '点评'),
|
||||
],
|
||||
onTap: (index) {
|
||||
if (!_tabController.indexIsChanging) {
|
||||
if (index == 0) {
|
||||
_controller.animToTop();
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: '关闭',
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: Get.back,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
child: TabBar(
|
||||
controller: _tabController,
|
||||
dividerHeight: 0,
|
||||
isScrollable: true,
|
||||
tabAlignment: TabAlignment.start,
|
||||
dividerColor: Colors.transparent,
|
||||
tabs: const [
|
||||
Tab(text: '详情'),
|
||||
Tab(text: '点评'),
|
||||
],
|
||||
onTap: (index) {
|
||||
if (!_tabController.indexIsChanging) {
|
||||
if (index == 0) {
|
||||
_controller.animToTop();
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
child: enableSlide ? slideList(theme) : buildList(theme),
|
||||
),
|
||||
IconButton(
|
||||
tooltip: '关闭',
|
||||
icon: const Icon(Icons.close, size: 20),
|
||||
onPressed: Get.back,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildList(ThemeData theme) {
|
||||
return TabBarView<TabBarDragGestureRecognizer>(
|
||||
controller: _tabController,
|
||||
physics: const CustomTabBarViewScrollPhysics(),
|
||||
horizontalDragGestureRecognizer: TabBarDragGestureRecognizer(
|
||||
isDxAllowed: (double dx) => enableSlide
|
||||
? dx > CommonSlideMixin.offset &&
|
||||
dx < maxWidth - CommonSlideMixin.offset
|
||||
: true,
|
||||
),
|
||||
children: [
|
||||
KeepAliveWrapper(builder: (context) => buildList(theme)),
|
||||
KeepAliveWrapper(builder: (context) => _buildInfo(theme)),
|
||||
PgcReviewPage(
|
||||
name: widget.item.title!,
|
||||
mediaId: widget.item.mediaId,
|
||||
@@ -94,8 +113,7 @@ class _IntroDetailState extends State<PgcIntroPanel>
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget buildList(ThemeData theme) {
|
||||
Widget _buildInfo(ThemeData theme) {
|
||||
final TextStyle smallTitle = TextStyle(
|
||||
fontSize: 12,
|
||||
color: theme.colorScheme.onSurface,
|
||||
|
||||
Reference in New Issue
Block a user