mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: switch btn
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -142,7 +142,7 @@ class _ListSheetContentState extends CommonSlidePageState<ListSheetContent>
|
|||||||
}();
|
}();
|
||||||
}
|
}
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (enableSlide && GStorage.collapsibleVideoPage) {
|
if (GStorage.collapsibleVideoPage) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isInit = false;
|
_isInit = false;
|
||||||
@@ -295,7 +295,7 @@ class _ListSheetContentState extends CommonSlidePageState<ListSheetContent>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (enableSlide && GStorage.collapsibleVideoPage && _isInit) {
|
if (GStorage.collapsibleVideoPage && _isInit) {
|
||||||
return CustomScrollView(
|
return CustomScrollView(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ abstract class CommonCollapseSlidePageState<T extends CommonCollapseSlidePage>
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
if (enableSlide && GStorage.collapsibleVideoPage) {
|
if (GStorage.collapsibleVideoPage) {
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
@@ -26,7 +26,7 @@ abstract class CommonCollapseSlidePageState<T extends CommonCollapseSlidePage>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
if (enableSlide && GStorage.collapsibleVideoPage && _isInit) {
|
if (GStorage.collapsibleVideoPage && _isInit) {
|
||||||
return CustomScrollView(
|
return CustomScrollView(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ import 'package:PiliPlus/pages/search/widgets/search_text.dart';
|
|||||||
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
import 'package:PiliPlus/pages/video/detail/introduction/controller.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/note/note_list_page.dart';
|
import 'package:PiliPlus/pages/video/detail/note/note_list_page.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/post_panel/post_panel.dart';
|
import 'package:PiliPlus/pages/video/detail/post_panel/post_panel.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/widgets/send_danmaku_panel.dart';
|
import 'package:PiliPlus/pages/video/detail/widgets/send_danmaku_panel.dart';
|
||||||
import 'package:PiliPlus/pages/video/detail/widgets/media_list_panel.dart';
|
import 'package:PiliPlus/pages/video/detail/widgets/media_list_panel.dart';
|
||||||
import 'package:PiliPlus/utils/extension.dart';
|
import 'package:PiliPlus/utils/extension.dart';
|
||||||
@@ -388,9 +386,7 @@ class VideoDetailController extends GetxController
|
|||||||
// 稍后再看面板展开
|
// 稍后再看面板展开
|
||||||
showMediaListPanel(context) {
|
showMediaListPanel(context) {
|
||||||
if (mediaList.isNotEmpty) {
|
if (mediaList.isNotEmpty) {
|
||||||
childKey.currentState?.showBottomSheet(
|
Widget panel() => MediaListPanel(
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
(context) => MediaListPanel(
|
|
||||||
mediaList: mediaList,
|
mediaList: mediaList,
|
||||||
changeMediaList: (bvid, cid, aid, cover) {
|
changeMediaList: (bvid, cid, aid, cover) {
|
||||||
try {
|
try {
|
||||||
@@ -438,42 +434,29 @@ class VideoDetailController extends GetxController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
if (plPlayerController.isFullScreen.value) {
|
||||||
|
Utils.showFSSheet(
|
||||||
|
context,
|
||||||
|
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||||
|
? Theme(
|
||||||
|
data: MyApp.darkThemeData!,
|
||||||
|
child: panel(),
|
||||||
|
)
|
||||||
|
: panel(),
|
||||||
|
isFullScreen: () => plPlayerController.isFullScreen.value,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
childKey.currentState?.showBottomSheet(
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
(context) => panel(),
|
||||||
|
);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
getMediaList();
|
getMediaList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 切换稍后再看
|
|
||||||
Future changeMediaList(bvid, cid, aid, cover) async {
|
|
||||||
try {
|
|
||||||
this.bvid = bvid;
|
|
||||||
oid.value = aid ?? IdUtils.bv2av(bvid);
|
|
||||||
this.cid.value = cid;
|
|
||||||
danmakuCid.value = cid;
|
|
||||||
videoItem['pic'] = cover;
|
|
||||||
queryVideoUrl();
|
|
||||||
|
|
||||||
if (showReply) {
|
|
||||||
Get.find<VideoReplyController>(tag: heroTag)
|
|
||||||
..aid = aid
|
|
||||||
..onRefresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
Get.find<VideoIntroController>(tag: heroTag)
|
|
||||||
..lastPlayCid.value = cid
|
|
||||||
..bvid = bvid
|
|
||||||
..queryVideoIntro();
|
|
||||||
|
|
||||||
if (showRelatedVideo) {
|
|
||||||
Get.find<RelatedController>(tag: heroTag)
|
|
||||||
..bvid = bvid
|
|
||||||
..onRefresh();
|
|
||||||
}
|
|
||||||
} catch (_) {}
|
|
||||||
}
|
|
||||||
|
|
||||||
int? _lastPos;
|
int? _lastPos;
|
||||||
double? _blockLimit;
|
double? _blockLimit;
|
||||||
List<Pair<SegmentType, SkipType>>? _blockSettings;
|
List<Pair<SegmentType, SkipType>>? _blockSettings;
|
||||||
|
|||||||
@@ -1782,7 +1782,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
showEpisodes(index, season, episodes, bvid, aid, cid) {
|
showEpisodes([index, season, episodes, bvid, aid, cid]) {
|
||||||
|
if (bvid == null) {
|
||||||
|
videoDetailController.showMediaListPanel(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Widget listSheetContent([bool? enableSlide]) => ListSheetContent(
|
Widget listSheetContent([bool? enableSlide]) => ListSheetContent(
|
||||||
enableSlide: enableSlide,
|
enableSlide: enableSlide,
|
||||||
index: index,
|
index: index,
|
||||||
|
|||||||
@@ -2185,7 +2185,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
showEpisodes(index, season, episodes, bvid, aid, cid) {
|
showEpisodes([index, season, episodes, bvid, aid, cid]) {
|
||||||
|
if (bvid == null) {
|
||||||
|
videoDetailController.showMediaListPanel(context);
|
||||||
|
return;
|
||||||
|
}
|
||||||
Widget listSheetContent([bool? enableSlide]) => ListSheetContent(
|
Widget listSheetContent([bool? enableSlide]) => ListSheetContent(
|
||||||
enableSlide: enableSlide,
|
enableSlide: enableSlide,
|
||||||
index: index,
|
index: index,
|
||||||
|
|||||||
@@ -262,10 +262,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
bool isPage = videoIntroController?.videoDetail.value.pages != null &&
|
bool isPage = videoIntroController?.videoDetail.value.pages != null &&
|
||||||
videoIntroController!.videoDetail.value.pages!.length > 1;
|
videoIntroController!.videoDetail.value.pages!.length > 1;
|
||||||
bool isBangumi = bangumiIntroController?.loadingState.value is Success;
|
bool isBangumi = bangumiIntroController?.loadingState.value is Success;
|
||||||
bool anySeason = isSeason ||
|
bool anySeason = isSeason || isPage || isBangumi;
|
||||||
isPage ||
|
|
||||||
isBangumi ||
|
|
||||||
widget.videoDetailController?.isPlayAll == true;
|
|
||||||
double widgetWidth =
|
double widgetWidth =
|
||||||
isFullScreen && context.orientation == Orientation.landscape ? 42 : 35;
|
isFullScreen && context.orientation == Orientation.landscape ? 42 : 35;
|
||||||
Map<BottomControlType, Widget> videoProgressWidgets = {
|
Map<BottomControlType, Widget> videoProgressWidgets = {
|
||||||
@@ -478,16 +475,18 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
|
if (anySeason.not) {
|
||||||
|
widget.showEpisodes?.call();
|
||||||
|
return;
|
||||||
|
}
|
||||||
int? index;
|
int? index;
|
||||||
int currentCid = plPlayerController.cid;
|
int currentCid = plPlayerController.cid;
|
||||||
String bvid = plPlayerController.bvid;
|
String bvid = plPlayerController.bvid;
|
||||||
List episodes = [];
|
List episodes = [];
|
||||||
// late Function changeFucCall;
|
|
||||||
if (isPage) {
|
if (isPage) {
|
||||||
final List<Part> pages =
|
final List<Part> pages =
|
||||||
videoIntroController!.videoDetail.value.pages!;
|
videoIntroController!.videoDetail.value.pages!;
|
||||||
episodes = pages;
|
episodes = pages;
|
||||||
// changeFucCall = videoIntroController!.changeSeasonOrbangu;
|
|
||||||
} else if (isSeason) {
|
} else if (isSeason) {
|
||||||
final List<SectionItem> sections =
|
final List<SectionItem> sections =
|
||||||
videoIntroController!.videoDetail.value.ugcSeason!.sections!;
|
videoIntroController!.videoDetail.value.ugcSeason!.sections!;
|
||||||
@@ -501,12 +500,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// changeFucCall = videoIntroController!.changeSeasonOrbangu;
|
|
||||||
} else if (isBangumi) {
|
} else if (isBangumi) {
|
||||||
episodes = (bangumiIntroController!.loadingState.value as Success)
|
episodes = (bangumiIntroController!.loadingState.value as Success)
|
||||||
.response
|
.response
|
||||||
.episodes!;
|
.episodes!;
|
||||||
// changeFucCall = bangumiIntroController!.changeSeasonOrbangu;
|
|
||||||
}
|
}
|
||||||
widget.showEpisodes?.call(
|
widget.showEpisodes?.call(
|
||||||
index,
|
index,
|
||||||
@@ -651,15 +648,18 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
List<BottomControlType> userSpecifyItemLeft = [
|
List<BottomControlType> userSpecifyItemLeft = [
|
||||||
BottomControlType.playOrPause,
|
BottomControlType.playOrPause,
|
||||||
BottomControlType.time,
|
BottomControlType.time,
|
||||||
if (anySeason) BottomControlType.pre,
|
if (anySeason || widget.videoDetailController?.isPlayAll == true) ...[
|
||||||
if (anySeason) BottomControlType.next,
|
BottomControlType.pre,
|
||||||
|
BottomControlType.next,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
List<BottomControlType> userSpecifyItemRight = [
|
List<BottomControlType> userSpecifyItemRight = [
|
||||||
BottomControlType.dmChart,
|
BottomControlType.dmChart,
|
||||||
BottomControlType.superResolution,
|
BottomControlType.superResolution,
|
||||||
BottomControlType.viewPoints,
|
BottomControlType.viewPoints,
|
||||||
if (anySeason) BottomControlType.episode,
|
if (anySeason || widget.videoDetailController?.isPlayAll == true)
|
||||||
|
BottomControlType.episode,
|
||||||
if (isFullScreen) BottomControlType.fit,
|
if (isFullScreen) BottomControlType.fit,
|
||||||
BottomControlType.subtitle,
|
BottomControlType.subtitle,
|
||||||
BottomControlType.speed,
|
BottomControlType.speed,
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:get/get_navigation/src/dialog/dialog_route.dart';
|
|
||||||
import 'package:share_plus/share_plus.dart';
|
import 'package:share_plus/share_plus.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
import 'package:html/dom.dart' as dom;
|
import 'package:html/dom.dart' as dom;
|
||||||
@@ -277,8 +276,9 @@ class Utils {
|
|||||||
required Function isFullScreen,
|
required Function isFullScreen,
|
||||||
double? padding,
|
double? padding,
|
||||||
}) {
|
}) {
|
||||||
Navigator.of(context).push(
|
Get.generalDialog(
|
||||||
GetDialogRoute(
|
barrierLabel: '',
|
||||||
|
barrierDismissible: true,
|
||||||
pageBuilder: (buildContext, animation, secondaryAnimation) {
|
pageBuilder: (buildContext, animation, secondaryAnimation) {
|
||||||
return MediaQuery.orientationOf(Get.context!) == Orientation.portrait
|
return MediaQuery.orientationOf(Get.context!) == Orientation.portrait
|
||||||
? SafeArea(
|
? SafeArea(
|
||||||
@@ -332,7 +332,7 @@ class Utils {
|
|||||||
child: child,
|
child: child,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
routeSettings: RouteSettings(arguments: Get.arguments),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user