fix: live fullScreen pip error

This commit is contained in:
guozhigq
2024-12-09 00:32:53 +08:00
parent bbc122142c
commit e24ac4fbfb

View File

@ -110,7 +110,8 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final isPortrait = mediaQuery.orientation == Orientation.portrait; final isPortrait = mediaQuery.orientation == Orientation.portrait;
final isLandscape = mediaQuery.orientation == Orientation.landscape; final RxBool isLandscape =
(mediaQuery.orientation == Orientation.landscape).obs;
final padding = mediaQuery.padding; final padding = mediaQuery.padding;
@ -194,7 +195,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Obx( Obx(
() => SizedBox( () => SizedBox(
height: padding.top + height: padding.top +
(_liveRoomController.isPortrait.value || isLandscape (_liveRoomController.isPortrait.value || isLandscape.value
? 0 ? 0
: kToolbarHeight), : kToolbarHeight),
), ),
@ -205,14 +206,14 @@ class _LiveRoomPageState extends State<LiveRoomPage>
if (plPlayerController.isFullScreen.value == true) { if (plPlayerController.isFullScreen.value == true) {
plPlayerController.triggerFullScreen(status: false); plPlayerController.triggerFullScreen(status: false);
} }
if (isLandscape) { if (isLandscape.value) {
verticalScreen(); verticalScreen();
} }
}, },
child: Obx( child: Obx(
() => Container( () => Container(
width: Get.size.width, width: Get.size.width,
height: isLandscape height: isLandscape.value
? Get.size.height ? Get.size.height
: !_liveRoomController.isPortrait.value : !_liveRoomController.isPortrait.value
? Get.size.width * 9 / 16 ? Get.size.width * 9 / 16
@ -313,7 +314,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
), ),
// 消息列表 // 消息列表
Visibility( Visibility(
visible: !isLandscape, visible: !isLandscape.value,
child: Obx( child: Obx(
() => Align( () => Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,