mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-01 00:28:18 +08:00
opt: episodes showing
This commit is contained in:
@@ -18,6 +18,7 @@ class ListSheet {
|
|||||||
required this.currentCid,
|
required this.currentCid,
|
||||||
required this.changeFucCall,
|
required this.changeFucCall,
|
||||||
required this.context,
|
required this.context,
|
||||||
|
this.scaffoldState,
|
||||||
});
|
});
|
||||||
|
|
||||||
final dynamic episodes;
|
final dynamic episodes;
|
||||||
@@ -26,20 +27,27 @@ class ListSheet {
|
|||||||
final int currentCid;
|
final int currentCid;
|
||||||
final Function changeFucCall;
|
final Function changeFucCall;
|
||||||
final BuildContext context;
|
final BuildContext context;
|
||||||
|
final ScaffoldState? scaffoldState;
|
||||||
|
|
||||||
late PersistentBottomSheetController bottomSheetController;
|
late PersistentBottomSheetController bottomSheetController;
|
||||||
|
|
||||||
|
Widget get listSheetContent => ListSheetContent(
|
||||||
|
episodes: episodes,
|
||||||
|
bvid: bvid,
|
||||||
|
aid: aid,
|
||||||
|
currentCid: currentCid,
|
||||||
|
changeFucCall: changeFucCall,
|
||||||
|
onClose: bottomSheetController.close,
|
||||||
|
);
|
||||||
|
|
||||||
void buildShowBottomSheet() {
|
void buildShowBottomSheet() {
|
||||||
bottomSheetController = showBottomSheet(
|
bottomSheetController = scaffoldState?.showBottomSheet(
|
||||||
context: context,
|
(context) => listSheetContent,
|
||||||
builder: (context) => ListSheetContent(
|
) ??
|
||||||
episodes: episodes,
|
showBottomSheet(
|
||||||
bvid: bvid,
|
context: context,
|
||||||
aid: aid,
|
builder: (context) => listSheetContent,
|
||||||
currentCid: currentCid,
|
);
|
||||||
changeFucCall: changeFucCall,
|
|
||||||
onClose: bottomSheetController.close,
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,9 +126,9 @@ class _ListSheetContentState extends State<ListSheetContent> {
|
|||||||
widget.changeFucCall(
|
widget.changeFucCall(
|
||||||
episode.bvid, episode.cid, episode.aid, episode.cover);
|
episode.bvid, episode.cid, episode.aid, episode.cover);
|
||||||
} else if (episode.runtimeType.toString() == "EpisodeItem") {
|
} else if (episode.runtimeType.toString() == "EpisodeItem") {
|
||||||
widget.changeFucCall(episode.bvid, episode.cid, episode.aid);
|
widget.changeFucCall(episode.bvid, episode.cid, episode.aid, null);
|
||||||
} else {
|
} else {
|
||||||
widget.changeFucCall(widget.bvid!, episode.cid, widget.aid!);
|
widget.changeFucCall(widget.bvid!, episode.cid, widget.aid!, null);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dense: false,
|
dense: false,
|
||||||
|
|||||||
@@ -24,10 +24,13 @@ import 'widgets/intro_detail.dart';
|
|||||||
class BangumiIntroPanel extends StatefulWidget {
|
class BangumiIntroPanel extends StatefulWidget {
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
const BangumiIntroPanel({
|
const BangumiIntroPanel({
|
||||||
Key? key,
|
Key? key,
|
||||||
this.cid,
|
this.cid,
|
||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
|
required this.showEpisodes,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -72,6 +75,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
loadingStatus: false,
|
loadingStatus: false,
|
||||||
bangumiDetail: loadingState.response,
|
bangumiDetail: loadingState.response,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
)
|
)
|
||||||
: loadingState is Error
|
: loadingState is Error
|
||||||
? HttpError(
|
? HttpError(
|
||||||
@@ -82,6 +86,7 @@ class _BangumiIntroPanelState extends State<BangumiIntroPanel>
|
|||||||
loadingStatus: true,
|
loadingStatus: true,
|
||||||
bangumiDetail: null,
|
bangumiDetail: null,
|
||||||
cid: cid,
|
cid: cid,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -92,11 +97,13 @@ class BangumiInfo extends StatefulWidget {
|
|||||||
this.loadingStatus = false,
|
this.loadingStatus = false,
|
||||||
this.bangumiDetail,
|
this.bangumiDetail,
|
||||||
this.cid,
|
this.cid,
|
||||||
|
required this.showEpisodes,
|
||||||
});
|
});
|
||||||
|
|
||||||
final bool loadingStatus;
|
final bool loadingStatus;
|
||||||
final BangumiInfoModel? bangumiDetail;
|
final BangumiInfoModel? bangumiDetail;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiInfo> createState() => _BangumiInfoState();
|
State<BangumiInfo> createState() => _BangumiInfoState();
|
||||||
@@ -342,6 +349,7 @@ class _BangumiInfoState extends State<BangumiInfo> {
|
|||||||
? bangumiItem!.episodes!.first.cid
|
? bangumiItem!.episodes!.first.cid
|
||||||
: widget.bangumiDetail!.episodes!.first.cid),
|
: widget.bangumiDetail!.episodes!.first.cid),
|
||||||
changeFuc: bangumiIntroController.changeSeasonOrbangu,
|
changeFuc: bangumiIntroController.changeSeasonOrbangu,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import 'package:PiliPalaX/models/bangumi/info.dart';
|
|||||||
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
import 'package:PiliPalaX/pages/video/detail/index.dart';
|
||||||
import 'package:PiliPalaX/utils/storage.dart';
|
import 'package:PiliPalaX/utils/storage.dart';
|
||||||
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
import 'package:scrollable_positioned_list/scrollable_positioned_list.dart';
|
||||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
|
||||||
|
|
||||||
class BangumiPanel extends StatefulWidget {
|
class BangumiPanel extends StatefulWidget {
|
||||||
const BangumiPanel({
|
const BangumiPanel({
|
||||||
@@ -14,11 +13,13 @@ class BangumiPanel extends StatefulWidget {
|
|||||||
required this.pages,
|
required this.pages,
|
||||||
this.cid,
|
this.cid,
|
||||||
required this.changeFuc,
|
required this.changeFuc,
|
||||||
|
required this.showEpisodes,
|
||||||
});
|
});
|
||||||
|
|
||||||
final List<EpisodeItem> pages;
|
final List<EpisodeItem> pages;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final Function changeFuc;
|
final Function changeFuc;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<BangumiPanel> createState() => _BangumiPanelState();
|
State<BangumiPanel> createState() => _BangumiPanelState();
|
||||||
@@ -113,18 +114,13 @@ class _BangumiPanelState extends State<BangumiPanel> {
|
|||||||
height: 34,
|
height: 34,
|
||||||
child: TextButton(
|
child: TextButton(
|
||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () => widget.showEpisodes(
|
||||||
ListSheet(
|
widget.pages,
|
||||||
episodes: widget.pages,
|
widget.pages[currentIndex].bvid,
|
||||||
bvid: widget.pages[currentIndex].bvid!,
|
widget.pages[currentIndex].aid,
|
||||||
aid: widget.pages[currentIndex].aid!,
|
cid),
|
||||||
currentCid: cid,
|
|
||||||
changeFucCall: widget.changeFuc,
|
|
||||||
context: context)
|
|
||||||
.buildShowBottomSheet();
|
|
||||||
},
|
|
||||||
child: Text(
|
child: Text(
|
||||||
'全${widget.pages.length}话',
|
'全${widget.pages.length}话',
|
||||||
style: const TextStyle(fontSize: 13),
|
style: const TextStyle(fontSize: 13),
|
||||||
|
|||||||
@@ -467,13 +467,16 @@ class VideoIntroController extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 修改分P或番剧分集
|
// 修改分P或番剧分集
|
||||||
Future changeSeasonOrbangu(bvid, cid, aid) async {
|
Future changeSeasonOrbangu(bvid, cid, aid, cover) async {
|
||||||
// 重新获取视频资源
|
// 重新获取视频资源
|
||||||
final VideoDetailController videoDetailCtr =
|
final VideoDetailController videoDetailCtr =
|
||||||
Get.find<VideoDetailController>(tag: heroTag);
|
Get.find<VideoDetailController>(tag: heroTag);
|
||||||
videoDetailCtr.bvid = bvid;
|
videoDetailCtr.bvid = bvid;
|
||||||
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
|
videoDetailCtr.oid.value = aid ?? IdUtils.bv2av(bvid);
|
||||||
videoDetailCtr.cid.value = cid;
|
videoDetailCtr.cid.value = cid;
|
||||||
|
if (cover is String && cover.isNotEmpty) {
|
||||||
|
videoItem!['pic'] = cover;
|
||||||
|
}
|
||||||
videoDetailCtr.danmakuCid.value = cid;
|
videoDetailCtr.danmakuCid.value = cid;
|
||||||
videoDetailCtr.queryVideoUrl();
|
videoDetailCtr.queryVideoUrl();
|
||||||
// 重新请求相关视频
|
// 重新请求相关视频
|
||||||
@@ -559,7 +562,7 @@ class VideoIntroController extends GetxController {
|
|||||||
final int cid = episodes[prevIndex].cid!;
|
final int cid = episodes[prevIndex].cid!;
|
||||||
final String rBvid = isPages ? bvid : episodes[prevIndex].bvid;
|
final String rBvid = isPages ? bvid : episodes[prevIndex].bvid;
|
||||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[prevIndex].aid!;
|
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[prevIndex].aid!;
|
||||||
changeSeasonOrbangu(rBvid, cid, rAid);
|
changeSeasonOrbangu(rBvid, cid, rAid, null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -607,7 +610,7 @@ class VideoIntroController extends GetxController {
|
|||||||
final int cid = episodes[nextIndex].cid!;
|
final int cid = episodes[nextIndex].cid!;
|
||||||
final String rBvid = isPages ? bvid : episodes[nextIndex].bvid;
|
final String rBvid = isPages ? bvid : episodes[nextIndex].bvid;
|
||||||
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
final int rAid = isPages ? IdUtils.bv2av(bvid) : episodes[nextIndex].aid!;
|
||||||
changeSeasonOrbangu(rBvid, cid, rAid);
|
changeSeasonOrbangu(rBvid, cid, rAid, null);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
|||||||
import 'widgets/action_item.dart';
|
import 'widgets/action_item.dart';
|
||||||
import 'widgets/action_row_item.dart';
|
import 'widgets/action_row_item.dart';
|
||||||
import 'widgets/fav_panel.dart';
|
import 'widgets/fav_panel.dart';
|
||||||
import 'widgets/intro_detail.dart';
|
|
||||||
import 'widgets/page.dart';
|
import 'widgets/page.dart';
|
||||||
import 'widgets/season.dart';
|
import 'widgets/season.dart';
|
||||||
|
|
||||||
@@ -30,10 +29,12 @@ class VideoIntroPanel extends StatefulWidget {
|
|||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
required this.showAiBottomSheet,
|
required this.showAiBottomSheet,
|
||||||
required this.showIntroDetail,
|
required this.showIntroDetail,
|
||||||
|
required this.showEpisodes,
|
||||||
});
|
});
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
final Function showAiBottomSheet;
|
final Function showAiBottomSheet;
|
||||||
final Function showIntroDetail;
|
final Function showIntroDetail;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VideoIntroPanel> createState() => _VideoIntroPanelState();
|
State<VideoIntroPanel> createState() => _VideoIntroPanelState();
|
||||||
@@ -82,6 +83,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: widget.showAiBottomSheet,
|
showAiBottomSheet: widget.showAiBottomSheet,
|
||||||
showIntroDetail: widget.showIntroDetail,
|
showIntroDetail: widget.showIntroDetail,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
)
|
)
|
||||||
: VideoInfo(
|
: VideoInfo(
|
||||||
//key:herotag
|
//key:herotag
|
||||||
@@ -91,6 +93,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: widget.showAiBottomSheet,
|
showAiBottomSheet: widget.showAiBottomSheet,
|
||||||
showIntroDetail: widget.showIntroDetail,
|
showIntroDetail: widget.showIntroDetail,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,6 +104,7 @@ class VideoInfo extends StatefulWidget {
|
|||||||
final String? heroTag;
|
final String? heroTag;
|
||||||
final Function showAiBottomSheet;
|
final Function showAiBottomSheet;
|
||||||
final Function showIntroDetail;
|
final Function showIntroDetail;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
const VideoInfo({
|
const VideoInfo({
|
||||||
Key? key,
|
Key? key,
|
||||||
@@ -109,6 +113,7 @@ class VideoInfo extends StatefulWidget {
|
|||||||
this.heroTag,
|
this.heroTag,
|
||||||
required this.showAiBottomSheet,
|
required this.showAiBottomSheet,
|
||||||
required this.showIntroDetail,
|
required this.showIntroDetail,
|
||||||
|
required this.showEpisodes,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -433,6 +438,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
? videoIntroController.lastPlayCid.value
|
? videoIntroController.lastPlayCid.value
|
||||||
: widget.videoDetail!.pages!.first.cid,
|
: widget.videoDetail!.pages!.first.cid,
|
||||||
changeFuc: videoIntroController.changeSeasonOrbangu,
|
changeFuc: videoIntroController.changeSeasonOrbangu,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
@@ -445,6 +451,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
cid: videoIntroController.lastPlayCid.value,
|
cid: videoIntroController.lastPlayCid.value,
|
||||||
bvid: videoIntroController.bvid,
|
bvid: videoIntroController.bvid,
|
||||||
changeFuc: videoIntroController.changeSeasonOrbangu,
|
changeFuc: videoIntroController.changeSeasonOrbangu,
|
||||||
|
showEpisodes: widget.showEpisodes,
|
||||||
))
|
))
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:PiliPalaX/models/video_detail_res.dart';
|
import 'package:PiliPalaX/models/video_detail_res.dart';
|
||||||
@@ -16,12 +15,14 @@ class PagesPanel extends StatefulWidget {
|
|||||||
required this.bvid,
|
required this.bvid,
|
||||||
required this.changeFuc,
|
required this.changeFuc,
|
||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
|
required this.showEpisodes,
|
||||||
});
|
});
|
||||||
final List<Part> pages;
|
final List<Part> pages;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final String bvid;
|
final String bvid;
|
||||||
final Function changeFuc;
|
final Function changeFuc;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<PagesPanel> createState() => _PagesPanelState();
|
State<PagesPanel> createState() => _PagesPanelState();
|
||||||
@@ -94,16 +95,8 @@ class _PagesPanelState extends State<PagesPanel> {
|
|||||||
style: ButtonStyle(
|
style: ButtonStyle(
|
||||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () => widget.showEpisodes(
|
||||||
ListSheet(
|
episodes, widget.bvid, IdUtils.bv2av(widget.bvid), cid),
|
||||||
episodes: episodes,
|
|
||||||
bvid: widget.bvid,
|
|
||||||
aid: IdUtils.bv2av(widget.bvid),
|
|
||||||
currentCid: cid,
|
|
||||||
changeFucCall: widget.changeFuc,
|
|
||||||
context: context,
|
|
||||||
).buildShowBottomSheet();
|
|
||||||
},
|
|
||||||
child: Text(
|
child: Text(
|
||||||
'共${widget.pages.length}集',
|
'共${widget.pages.length}集',
|
||||||
style: const TextStyle(fontSize: 13),
|
style: const TextStyle(fontSize: 13),
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:PiliPalaX/models/video_detail_res.dart';
|
import 'package:PiliPalaX/models/video_detail_res.dart';
|
||||||
@@ -11,11 +10,13 @@ class SeasonPanel extends StatefulWidget {
|
|||||||
this.cid,
|
this.cid,
|
||||||
required this.changeFuc,
|
required this.changeFuc,
|
||||||
required this.heroTag,
|
required this.heroTag,
|
||||||
|
required this.showEpisodes,
|
||||||
});
|
});
|
||||||
final UgcSeason ugcSeason;
|
final UgcSeason ugcSeason;
|
||||||
final int? cid;
|
final int? cid;
|
||||||
final Function changeFuc;
|
final Function changeFuc;
|
||||||
final String heroTag;
|
final String heroTag;
|
||||||
|
final Function showEpisodes;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<SeasonPanel> createState() => _SeasonPanelState();
|
State<SeasonPanel> createState() => _SeasonPanelState();
|
||||||
@@ -102,16 +103,7 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
|||||||
borderRadius: BorderRadius.circular(6),
|
borderRadius: BorderRadius.circular(6),
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () => widget.showEpisodes(episodes, null, null, cid),
|
||||||
ListSheet(
|
|
||||||
episodes: episodes,
|
|
||||||
// bvid: IdUtils.av2bv(episodes!.first.aid!),
|
|
||||||
// aid: episodes!.first.aid!,
|
|
||||||
currentCid: cid,
|
|
||||||
changeFucCall: widget.changeFuc,
|
|
||||||
context: context)
|
|
||||||
.buildShowBottomSheet();
|
|
||||||
},
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
padding: const EdgeInsets.fromLTRB(8, 12, 8, 12),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:io';
|
|||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:PiliPalaX/common/constants.dart';
|
import 'package:PiliPalaX/common/constants.dart';
|
||||||
|
import 'package:PiliPalaX/common/widgets/list_sheet.dart';
|
||||||
import 'package:PiliPalaX/http/loading_state.dart';
|
import 'package:PiliPalaX/http/loading_state.dart';
|
||||||
import 'package:PiliPalaX/models/common/reply_type.dart';
|
import 'package:PiliPalaX/models/common/reply_type.dart';
|
||||||
import 'package:PiliPalaX/pages/video/detail/introduction/widgets/intro_detail.dart';
|
import 'package:PiliPalaX/pages/video/detail/introduction/widgets/intro_detail.dart';
|
||||||
@@ -420,6 +421,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
Widget tabbarBuild([
|
Widget tabbarBuild([
|
||||||
bool needIndicator = true,
|
bool needIndicator = true,
|
||||||
String introText = '简介',
|
String introText = '简介',
|
||||||
|
bool isSingle = false,
|
||||||
]) {
|
]) {
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
@@ -439,6 +441,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
flex: 1,
|
flex: 1,
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => TabBar(
|
() => TabBar(
|
||||||
|
labelColor: needIndicator
|
||||||
|
? null
|
||||||
|
: Theme.of(context).colorScheme.onSurface,
|
||||||
indicatorColor: needIndicator ? null : Colors.transparent,
|
indicatorColor: needIndicator ? null : Colors.transparent,
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
controller: videoDetailController.tabCtr,
|
controller: videoDetailController.tabCtr,
|
||||||
@@ -447,7 +452,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
horizontal: 10.0), // 设置每个标签的宽度
|
horizontal: 10.0), // 设置每个标签的宽度
|
||||||
dividerColor: Colors.transparent,
|
dividerColor: Colors.transparent,
|
||||||
onTap: (value) {
|
onTap: (value) {
|
||||||
if (!needIndicator ||
|
if (isSingle) {
|
||||||
|
_videoReplyController.animateToTop();
|
||||||
|
} else if (!needIndicator ||
|
||||||
!videoDetailController.tabCtr.indexIsChanging) {
|
!videoDetailController.tabCtr.indexIsChanging) {
|
||||||
if (value == 0) {
|
if (value == 0) {
|
||||||
_introController.animToTop();
|
_introController.animToTop();
|
||||||
@@ -457,7 +464,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
tabs: [
|
tabs: [
|
||||||
Tab(text: introText),
|
if (!isSingle) Tab(text: introText),
|
||||||
Tab(
|
Tab(
|
||||||
text:
|
text:
|
||||||
'评论${_videoReplyController.count.value == -1 ? '' : ' ${_videoReplyController.count.value}'}',
|
'评论${_videoReplyController.count.value == -1 ? '' : ' ${_videoReplyController.count.value}'}',
|
||||||
@@ -718,14 +725,17 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: showAiBottomSheet,
|
showAiBottomSheet: showAiBottomSheet,
|
||||||
showIntroDetail: showIntroDetail,
|
showIntroDetail: showIntroDetail,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
),
|
),
|
||||||
] else if (videoDetailController
|
] else if (videoDetailController
|
||||||
.videoType ==
|
.videoType ==
|
||||||
SearchType.media_bangumi) ...[
|
SearchType.media_bangumi) ...[
|
||||||
Obx(() => BangumiIntroPanel(
|
Obx(() => BangumiIntroPanel(
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid:
|
cid:
|
||||||
videoDetailController.cid.value)),
|
videoDetailController.cid.value,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -837,12 +847,15 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: showAiBottomSheet,
|
showAiBottomSheet: showAiBottomSheet,
|
||||||
showIntroDetail: showIntroDetail,
|
showIntroDetail: showIntroDetail,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
),
|
),
|
||||||
] else if (videoDetailController.videoType ==
|
] else if (videoDetailController.videoType ==
|
||||||
SearchType.media_bangumi) ...[
|
SearchType.media_bangumi) ...[
|
||||||
Obx(() => BangumiIntroPanel(
|
Obx(() => BangumiIntroPanel(
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value)),
|
cid: videoDetailController.cid.value,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
SliverToBoxAdapter(
|
SliverToBoxAdapter(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
@@ -948,13 +961,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: showAiBottomSheet,
|
showAiBottomSheet: showAiBottomSheet,
|
||||||
showIntroDetail: showIntroDetail,
|
showIntroDetail: showIntroDetail,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
),
|
),
|
||||||
RelatedVideoPanel(heroTag: heroTag),
|
RelatedVideoPanel(heroTag: heroTag),
|
||||||
] else if (videoDetailController.videoType ==
|
] else if (videoDetailController.videoType ==
|
||||||
SearchType.media_bangumi) ...[
|
SearchType.media_bangumi) ...[
|
||||||
Obx(() => BangumiIntroPanel(
|
Obx(() => BangumiIntroPanel(
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value)),
|
cid: videoDetailController.cid.value,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
|
)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
@@ -988,12 +1004,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: showAiBottomSheet,
|
showAiBottomSheet: showAiBottomSheet,
|
||||||
showIntroDetail: showIntroDetail,
|
showIntroDetail: showIntroDetail,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
),
|
),
|
||||||
RelatedVideoPanel(heroTag: heroTag),
|
RelatedVideoPanel(heroTag: heroTag),
|
||||||
] else if (videoDetailController.videoType ==
|
] else if (videoDetailController.videoType ==
|
||||||
SearchType.media_bangumi) ...[
|
SearchType.media_bangumi) ...[
|
||||||
Obx(() => BangumiIntroPanel(
|
Obx(() => BangumiIntroPanel(
|
||||||
heroTag: heroTag, cid: videoDetailController.cid.value)),
|
heroTag: heroTag,
|
||||||
|
cid: videoDetailController.cid.value,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
|
)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
@@ -1046,9 +1066,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Scaffold(
|
child: Expanded(
|
||||||
key: scaffoldKey,
|
child: Scaffold(
|
||||||
body: videoReplyPanel,
|
key: scaffoldKey,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
tabbarBuild(false, '', true),
|
||||||
|
Expanded(child: videoReplyPanel),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
// Expanded(
|
// Expanded(
|
||||||
@@ -1164,13 +1191,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
showAiBottomSheet: showAiBottomSheet,
|
showAiBottomSheet: showAiBottomSheet,
|
||||||
showIntroDetail: showIntroDetail,
|
showIntroDetail: showIntroDetail,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
),
|
),
|
||||||
// RelatedVideoPanel(heroTag: heroTag),
|
// RelatedVideoPanel(heroTag: heroTag),
|
||||||
] else if (videoDetailController.videoType ==
|
] else if (videoDetailController.videoType ==
|
||||||
SearchType.media_bangumi) ...[
|
SearchType.media_bangumi) ...[
|
||||||
Obx(() => BangumiIntroPanel(
|
Obx(() => BangumiIntroPanel(
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
cid: videoDetailController.cid.value)),
|
cid: videoDetailController.cid.value,
|
||||||
|
showEpisodes: showEpisodes,
|
||||||
|
)),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@@ -1193,7 +1223,13 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
key: scaffoldKey,
|
key: scaffoldKey,
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
tabbarBuild(true, '相关视频'),
|
tabbarBuild(
|
||||||
|
videoDetailController.videoType !=
|
||||||
|
SearchType.media_bangumi,
|
||||||
|
'相关视频',
|
||||||
|
videoDetailController.videoType ==
|
||||||
|
SearchType.media_bangumi,
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: TabBarView(
|
child: TabBarView(
|
||||||
physics: const BouncingScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
@@ -1408,4 +1444,16 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
scaffoldKey.currentState?.showBottomSheet(
|
scaffoldKey.currentState?.showBottomSheet(
|
||||||
enableDrag: true, (context) => IntroDetail(videoDetail: videoDetail));
|
enableDrag: true, (context) => IntroDetail(videoDetail: videoDetail));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showEpisodes(episodes, bvid, aid, cid) {
|
||||||
|
ListSheet(
|
||||||
|
episodes: episodes,
|
||||||
|
bvid: bvid,
|
||||||
|
aid: aid,
|
||||||
|
currentCid: cid,
|
||||||
|
changeFucCall: videoIntroController.changeSeasonOrbangu,
|
||||||
|
context: context,
|
||||||
|
scaffoldState: scaffoldKey.currentState,
|
||||||
|
).buildShowBottomSheet();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user