opt: video sheet

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-11 13:18:53 +08:00
parent a6a1de169b
commit 4aa3d5f273
6 changed files with 1134 additions and 1051 deletions

View File

@@ -84,7 +84,11 @@ void imageSaveDialog({
SmartDialog.dismiss(); SmartDialog.dismiss();
} }
}, },
icon: const Icon(Icons.download, size: 20), icon: Icon(
Icons.download,
size: 20,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
) )
], ],
), ),

View File

@@ -7,6 +7,7 @@ import 'package:PiliPlus/common/widgets/segment_progress_bar.dart';
import 'package:PiliPlus/http/init.dart'; import 'package:PiliPlus/http/init.dart';
import 'package:PiliPlus/http/loading_state.dart'; import 'package:PiliPlus/http/loading_state.dart';
import 'package:PiliPlus/http/user.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/action_type.dart';
import 'package:PiliPlus/models/common/sponsor_block/post_segment_model.dart'; import 'package:PiliPlus/models/common/sponsor_block/post_segment_model.dart';
import 'package:PiliPlus/models/common/sponsor_block/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) { if (plPlayerController.isFullScreen.value) {
Utils.showFSSheet( Utils.showFSSheet(
child: PostPanel( context,
enableSlide: false, child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
videoDetailController: this, ? Theme(
plPlayerController: plPlayerController, data: MyApp.darkThemeData!,
), child: PostPanel(
enableSlide: false,
videoDetailController: this,
plPlayerController: plPlayerController,
),
)
: PostPanel(
enableSlide: false,
videoDetailController: this,
plPlayerController: plPlayerController,
),
isFullScreen: () => plPlayerController.isFullScreen.value, isFullScreen: () => plPlayerController.isFullScreen.value,
); );
} else { } else {
@@ -1597,10 +1608,19 @@ class VideoDetailController extends GetxController
void showNoteList(BuildContext context) async { void showNoteList(BuildContext context) async {
if (plPlayerController.isFullScreen.value) { if (plPlayerController.isFullScreen.value) {
Utils.showFSSheet( Utils.showFSSheet(
child: NoteListPage( context,
oid: oid.value, child: plPlayerController.darkVideoPage && MyApp.darkThemeData != null
enableSlide: false, ? Theme(
), data: MyApp.darkThemeData!,
child: NoteListPage(
oid: oid.value,
enableSlide: false,
),
)
: NoteListPage(
oid: oid.value,
enableSlide: false,
),
isFullScreen: () => plPlayerController.isFullScreen.value, isFullScreen: () => plPlayerController.isFullScreen.value,
); );
} else { } else {

View File

@@ -1813,7 +1813,11 @@ class _VideoDetailPageState extends State<VideoDetailPage>
); );
if (isFullScreen) { if (isFullScreen) {
Utils.showFSSheet( Utils.showFSSheet(
child: listSheetContent(false), context,
child: Theme(
data: themeData,
child: listSheetContent(false),
),
isFullScreen: () => isFullScreen, isFullScreen: () => isFullScreen,
); );
} else { } else {
@@ -1897,10 +1901,14 @@ class _VideoDetailPageState extends State<VideoDetailPage>
void showViewPoints() { void showViewPoints() {
if (isFullScreen) { if (isFullScreen) {
Utils.showFSSheet( Utils.showFSSheet(
child: ViewPointsPage( context,
enableSlide: false, child: Theme(
videoDetailController: videoDetailController, data: themeData,
plPlayerController: plPlayerController, child: ViewPointsPage(
enableSlide: false,
videoDetailController: videoDetailController,
plPlayerController: plPlayerController,
),
), ),
isFullScreen: () => isFullScreen, isFullScreen: () => isFullScreen,
); );

View File

@@ -2217,7 +2217,11 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
); );
if (isFullScreen) { if (isFullScreen) {
Utils.showFSSheet( Utils.showFSSheet(
child: listSheetContent(false), context,
child: Theme(
data: themeData,
child: listSheetContent(false),
),
isFullScreen: () => isFullScreen, isFullScreen: () => isFullScreen,
); );
} else { } else {
@@ -2301,10 +2305,14 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
void showViewPoints() { void showViewPoints() {
if (isFullScreen) { if (isFullScreen) {
Utils.showFSSheet( Utils.showFSSheet(
child: ViewPointsPage( context,
enableSlide: false, child: Theme(
videoDetailController: videoDetailController, data: themeData,
plPlayerController: plPlayerController, child: ViewPointsPage(
enableSlide: false,
videoDetailController: videoDetailController,
plPlayerController: plPlayerController,
),
), ),
isFullScreen: () => isFullScreen, isFullScreen: () => isFullScreen,
); );

File diff suppressed because it is too large Load Diff

View File

@@ -270,41 +270,52 @@ class Utils {
} }
} }
static void showFSSheet({ static void showFSSheet(
BuildContext context, {
required Widget child, required Widget child,
required Function isFullScreen, required Function isFullScreen,
double? padding, double? padding,
}) { }) {
Navigator.of(Get.context!).push( Navigator.of(context).push(
GetDialogRoute( GetDialogRoute(
pageBuilder: (buildContext, animation, secondaryAnimation) { pageBuilder: (buildContext, animation, secondaryAnimation) {
return MediaQuery.orientationOf(Get.context!) == Orientation.portrait return MediaQuery.orientationOf(Get.context!) == Orientation.portrait
? Column( ? SafeArea(
children: [ child: Column(
const Spacer(flex: 3), children: [
Expanded( const Spacer(flex: 3),
flex: 7, Expanded(
child: MediaQuery.removePadding( flex: 7,
context: Get.context!, child: MediaQuery.removePadding(
removeTop: true, context: context,
child: child, removeTop: true,
removeBottom: true,
removeLeft: true,
removeRight: true,
child: child,
),
), ),
), if (isFullScreen() && padding != null)
if (isFullScreen() && padding != null) SizedBox(height: padding),
SizedBox(height: padding), ],
], ),
) )
: Row( : SafeArea(
children: [ child: Row(
const Spacer(), children: [
Expanded( const Spacer(),
child: MediaQuery.removePadding( Expanded(
context: Get.context!, child: MediaQuery.removePadding(
removeLeft: true, context: context,
child: child, removeTop: true,
removeBottom: true,
removeLeft: true,
removeRight: true,
child: child,
),
), ),
), ],
], ),
); );
}, },
transitionDuration: const Duration(milliseconds: 350), transitionDuration: const Duration(milliseconds: 350),