mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
feat: custom horizontal preview
Closes #117 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -4,6 +4,7 @@ import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/common/constants.dart';
|
||||
import 'package:PiliPlus/common/widgets/icon_button.dart';
|
||||
import 'package:PiliPlus/common/widgets/interactiveviewer_gallery/interactiveviewer_gallery.dart';
|
||||
import 'package:PiliPlus/common/widgets/list_sheet.dart';
|
||||
import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
@@ -94,6 +95,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
context.orientation == Orientation.landscape &&
|
||||
videoDetailController.horizontalSeasonPanel;
|
||||
|
||||
bool get _horizontalPreview =>
|
||||
context.orientation == Orientation.landscape &&
|
||||
videoDetailController.horizontalPreview;
|
||||
|
||||
StreamSubscription? _listenerDetail;
|
||||
StreamSubscription? _listenerLoadingState;
|
||||
StreamSubscription? _listenerCid;
|
||||
@@ -1543,6 +1548,22 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
replyReply: replyReply,
|
||||
onViewImage: videoDetailController.onViewImage,
|
||||
onDismissed: videoDetailController.onDismissed,
|
||||
callback: _horizontalPreview
|
||||
? (imgList, index) {
|
||||
videoDetailController.childKey.currentState?.showBottomSheet(
|
||||
(context) {
|
||||
return InteractiveviewerGallery(
|
||||
sources: imgList,
|
||||
initIndex: index,
|
||||
setStatusBar: false,
|
||||
);
|
||||
},
|
||||
enableDrag: false,
|
||||
elevation: 0,
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
}
|
||||
: null,
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user