mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: video sheet
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -84,7 +84,11 @@ void imageSaveDialog({
|
||||
SmartDialog.dismiss();
|
||||
}
|
||||
},
|
||||
icon: const Icon(Icons.download, size: 20),
|
||||
icon: Icon(
|
||||
Icons.download,
|
||||
size: 20,
|
||||
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/main.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/action_type.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/post_segment_model.dart';
|
||||
import 'package:PiliPlus/models/common/sponsor_block/segment_model.dart';
|
||||
@@ -1331,11 +1332,21 @@ class VideoDetailController extends GetxController
|
||||
}
|
||||
if (plPlayerController.isFullScreen.value) {
|
||||
Utils.showFSSheet(
|
||||
child: PostPanel(
|
||||
enableSlide: false,
|
||||
videoDetailController: this,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
context,
|
||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||
? Theme(
|
||||
data: MyApp.darkThemeData!,
|
||||
child: PostPanel(
|
||||
enableSlide: false,
|
||||
videoDetailController: this,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
)
|
||||
: PostPanel(
|
||||
enableSlide: false,
|
||||
videoDetailController: this,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
isFullScreen: () => plPlayerController.isFullScreen.value,
|
||||
);
|
||||
} else {
|
||||
@@ -1597,10 +1608,19 @@ class VideoDetailController extends GetxController
|
||||
void showNoteList(BuildContext context) async {
|
||||
if (plPlayerController.isFullScreen.value) {
|
||||
Utils.showFSSheet(
|
||||
child: NoteListPage(
|
||||
oid: oid.value,
|
||||
enableSlide: false,
|
||||
),
|
||||
context,
|
||||
child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
|
||||
? Theme(
|
||||
data: MyApp.darkThemeData!,
|
||||
child: NoteListPage(
|
||||
oid: oid.value,
|
||||
enableSlide: false,
|
||||
),
|
||||
)
|
||||
: NoteListPage(
|
||||
oid: oid.value,
|
||||
enableSlide: false,
|
||||
),
|
||||
isFullScreen: () => plPlayerController.isFullScreen.value,
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -1813,7 +1813,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
);
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
child: listSheetContent(false),
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: listSheetContent(false),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
} else {
|
||||
@@ -1897,10 +1901,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
void showViewPoints() {
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
child: ViewPointsPage(
|
||||
enableSlide: false,
|
||||
videoDetailController: videoDetailController,
|
||||
plPlayerController: plPlayerController,
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: ViewPointsPage(
|
||||
enableSlide: false,
|
||||
videoDetailController: videoDetailController,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
|
||||
@@ -2217,7 +2217,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
);
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
child: listSheetContent(false),
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: listSheetContent(false),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
} else {
|
||||
@@ -2301,10 +2305,14 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
void showViewPoints() {
|
||||
if (isFullScreen) {
|
||||
Utils.showFSSheet(
|
||||
child: ViewPointsPage(
|
||||
enableSlide: false,
|
||||
videoDetailController: videoDetailController,
|
||||
plPlayerController: plPlayerController,
|
||||
context,
|
||||
child: Theme(
|
||||
data: themeData,
|
||||
child: ViewPointsPage(
|
||||
enableSlide: false,
|
||||
videoDetailController: videoDetailController,
|
||||
plPlayerController: plPlayerController,
|
||||
),
|
||||
),
|
||||
isFullScreen: () => isFullScreen,
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -270,41 +270,52 @@ class Utils {
|
||||
}
|
||||
}
|
||||
|
||||
static void showFSSheet({
|
||||
static void showFSSheet(
|
||||
BuildContext context, {
|
||||
required Widget child,
|
||||
required Function isFullScreen,
|
||||
double? padding,
|
||||
}) {
|
||||
Navigator.of(Get.context!).push(
|
||||
Navigator.of(context).push(
|
||||
GetDialogRoute(
|
||||
pageBuilder: (buildContext, animation, secondaryAnimation) {
|
||||
return MediaQuery.orientationOf(Get.context!) == Orientation.portrait
|
||||
? Column(
|
||||
children: [
|
||||
const Spacer(flex: 3),
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: MediaQuery.removePadding(
|
||||
context: Get.context!,
|
||||
removeTop: true,
|
||||
child: child,
|
||||
? SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
const Spacer(flex: 3),
|
||||
Expanded(
|
||||
flex: 7,
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeTop: true,
|
||||
removeBottom: true,
|
||||
removeLeft: true,
|
||||
removeRight: true,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isFullScreen() && padding != null)
|
||||
SizedBox(height: padding),
|
||||
],
|
||||
if (isFullScreen() && padding != null)
|
||||
SizedBox(height: padding),
|
||||
],
|
||||
),
|
||||
)
|
||||
: Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
context: Get.context!,
|
||||
removeLeft: true,
|
||||
child: child,
|
||||
: SafeArea(
|
||||
child: Row(
|
||||
children: [
|
||||
const Spacer(),
|
||||
Expanded(
|
||||
child: MediaQuery.removePadding(
|
||||
context: context,
|
||||
removeTop: true,
|
||||
removeBottom: true,
|
||||
removeLeft: true,
|
||||
removeRight: true,
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
transitionDuration: const Duration(milliseconds: 350),
|
||||
|
||||
Reference in New Issue
Block a user