Merge branch 'design'

This commit is contained in:
guozhigq
2024-12-06 23:55:09 +08:00
3 changed files with 42 additions and 37 deletions

View File

@ -37,6 +37,7 @@ class MemberSearchController extends GetxController {
} else {
Get.back();
}
loadingStatus.value = 'init';
}
void onChange(value) {
@ -76,7 +77,7 @@ class MemberSearchController extends GetxController {
archivePn += 1;
hasRequest = true;
}
// loadingStatus.value = 'finish';
loadingStatus.value = 'finish';
return res;
}

View File

@ -502,7 +502,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
@override
Widget build(BuildContext context) {
final sizeContext = MediaQuery.sizeOf(context);
final _context = MediaQuery.of(context);
final orientation = MediaQuery.orientationOf(context);
late final double verticalHeight = sizeContext.width * 22 / 16;
late double defaultVideoHeight = vdCtr.videoDirection.value == 'vertical'
? verticalHeight
@ -517,12 +517,12 @@ class _VideoDetailPageState extends State<VideoDetailPage>
});
// 竖屏
final bool isPortrait = _context.orientation == Orientation.portrait;
final bool isPortrait = orientation == Orientation.portrait;
// 横屏
final bool isLandscape = _context.orientation == Orientation.landscape;
final bool isLandscape = orientation == Orientation.landscape;
final Rx<bool> isFullScreen = plPlayerController?.isFullScreen ?? false.obs;
// 全屏时高度撑满
if (isLandscape || isFullScreen.value == true) {
if (isLandscape || isFullScreen.value) {
videoHeight.value = Get.size.height;
enterFullScreen();
} else {
@ -634,10 +634,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
}
Widget childWhenDisabled = SafeArea(
top: MediaQuery.of(context).orientation == Orientation.portrait &&
plPlayerController?.isFullScreen.value == true,
bottom: MediaQuery.of(context).orientation == Orientation.portrait &&
plPlayerController?.isFullScreen.value == true,
top: isPortrait && isFullScreen.value,
bottom: isPortrait && isFullScreen.value,
left: false,
right: false,
child: Stack(
@ -660,22 +658,25 @@ class _VideoDetailPageState extends State<VideoDetailPage>
return <Widget>[
Obx(
() {
final Orientation orientation =
MediaQuery.of(context).orientation;
final bool isLandscape =
MediaQuery.orientationOf(context) ==
Orientation.landscape;
final bool isFullScreen =
plPlayerController?.isFullScreen.value == true;
final double expandedHeight =
orientation == Orientation.landscape || isFullScreen
? (MediaQuery.sizeOf(context).height -
(orientation == Orientation.landscape
? 0
: MediaQuery.of(context).padding.top))
: videoHeight.value;
if (orientation == Orientation.landscape ||
isFullScreen) {
plPlayerController?.isFullScreen.value ?? false;
late double expandedHeight;
if (isLandscape || isFullScreen) {
enterFullScreen();
expandedHeight = (MediaQuery.sizeOf(context).height -
(isLandscape
? 0
: MediaQuery.paddingOf(context).top));
} else {
exitFullScreen();
if (vdCtr.videoDirection.value == 'vertical') {
videoHeight.value = verticalHeight;
}
expandedHeight = videoHeight.value;
}
return SliverAppBar(
automaticallyImplyLeading: false,
@ -687,21 +688,24 @@ class _VideoDetailPageState extends State<VideoDetailPage>
backgroundColor: Colors.black,
flexibleSpace: SizedBox.expand(
child: PopScope(
canPop:
plPlayerController?.isFullScreen.value != true,
canPop: !isFullScreen,
onPopInvoked: (bool didPop) {
if (plPlayerController?.controlsLock.value ==
true) {
plPlayerController?.onLockControl(false);
return;
if (plPlayerController != null) {
if (plPlayerController!.controlsLock.value) {
plPlayerController!.onLockControl(false);
return;
}
if (isFullScreen) {
plPlayerController!
.triggerFullScreen(status: false);
if (vdCtr.videoDirection.value ==
'vertical') {
videoHeight.value = verticalHeight;
}
}
}
if (plPlayerController?.isFullScreen.value ==
true) {
plPlayerController!
.triggerFullScreen(status: false);
}
if (MediaQuery.of(context).orientation ==
Orientation.landscape) {
if (isLandscape) {
verticalScreen();
}
},
@ -746,9 +750,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
/// 不收回
pinnedHeaderSliverHeightBuilder: () {
return MediaQuery.of(context).orientation ==
Orientation.landscape ||
plPlayerController?.isFullScreen.value == true
return isLandscape || isFullScreen.value
? MediaQuery.sizeOf(context).height
: playerStatus.value != PlayerStatus.playing
? kToolbarHeight

View File

@ -732,6 +732,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
lastFullScreenToggleTime = DateTime.now();
// 下滑退出全屏
await widget.controller.triggerFullScreen(status: flag);
widget.fullScreenCb?.call(flag);
}
_distance.value = 0.0;
} else if (dy < _distance.value &&
@ -741,6 +742,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
lastFullScreenToggleTime = DateTime.now();
// 上滑进入全屏
await widget.controller.triggerFullScreen(status: !flag);
widget.fullScreenCb?.call(!flag);
}
_distance.value = 0.0;
}