fix: live room

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-23 18:10:51 +08:00
parent 14129e8f21
commit 811b79610c

View File

@@ -271,91 +271,93 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Color get _color => Color(0xFFEEEEEE); Color get _color => Color(0xFFEEEEEE);
Widget get _buildAppBar => AppBar( Widget get _buildAppBar => Obx(
backgroundColor: Colors.transparent, () => AppBar(
foregroundColor: Colors.white, backgroundColor: Colors.transparent,
titleTextStyle: TextStyle(color: Colors.white), foregroundColor: Colors.white,
toolbarHeight: titleTextStyle: TextStyle(color: Colors.white),
MediaQuery.of(context).orientation == Orientation.portrait ? 56 : 0, toolbarHeight: plPlayerController.isFullScreen.value ? 0 : null,
title: FutureBuilder( title: FutureBuilder(
future: _futureBuilder, future: _futureBuilder,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.data == null) { if (snapshot.data == null) {
return const SizedBox(); return const SizedBox();
} }
Map data = snapshot.data as Map; Map data = snapshot.data as Map;
if (data['status']) { if (data['status']) {
return Obx( return Obx(
() => Row( () => Row(
children: [ children: [
GestureDetector( GestureDetector(
onTap: () { onTap: () {
_node.unfocus(); _node.unfocus();
dynamic uid = dynamic uid = _liveRoomController
_liveRoomController.roomInfoH5.value.roomInfo?.uid; .roomInfoH5.value.roomInfo?.uid;
Get.toNamed( Get.toNamed(
'/member?mid=$uid', '/member?mid=$uid',
arguments: { arguments: {
'heroTag': Utils.makeHeroTag(uid), 'heroTag': Utils.makeHeroTag(uid),
}, },
);
},
child: NetworkImgLayer(
width: 34,
height: 34,
type: 'avatar',
src: _liveRoomController
.roomInfoH5.value.anchorInfo!.baseInfo!.face,
),
),
const SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_liveRoomController
.roomInfoH5.value.anchorInfo!.baseInfo!.uname!,
style: const TextStyle(fontSize: 14),
),
const SizedBox(height: 1),
if (_liveRoomController.roomInfoH5.value.watchedShow !=
null)
Text(
_liveRoomController.roomInfoH5.value
.watchedShow!['text_large'] ??
'',
style: const TextStyle(fontSize: 12),
),
],
),
const Spacer(),
//刷新
IconButton(
tooltip: '刷新',
onPressed: () {
_futureBuilderFuture =
_liveRoomController.queryLiveInfo();
// videoSourceInit();
},
icon: const Icon(Icons.refresh),
),
//内置浏览器打开
IconButton(
tooltip: '浏览器打开',
onPressed: () {
Utils.inAppWebview(
'https://live.bilibili.com/h5/${_liveRoomController.roomId}',
off: true,
); );
}, },
icon: const Icon(Icons.open_in_browser)), child: NetworkImgLayer(
], width: 34,
), height: 34,
); type: 'avatar',
} else { src: _liveRoomController
return const SizedBox(); .roomInfoH5.value.anchorInfo!.baseInfo!.face,
} ),
}, ),
const SizedBox(width: 10),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
_liveRoomController
.roomInfoH5.value.anchorInfo!.baseInfo!.uname!,
style: const TextStyle(fontSize: 14),
),
const SizedBox(height: 1),
if (_liveRoomController
.roomInfoH5.value.watchedShow !=
null)
Text(
_liveRoomController.roomInfoH5.value
.watchedShow!['text_large'] ??
'',
style: const TextStyle(fontSize: 12),
),
],
),
const Spacer(),
//刷新
IconButton(
tooltip: '刷新',
onPressed: () {
_futureBuilderFuture =
_liveRoomController.queryLiveInfo();
// videoSourceInit();
},
icon: const Icon(Icons.refresh),
),
//内置浏览器打开
IconButton(
tooltip: '浏览器打开',
onPressed: () {
Utils.inAppWebview(
'https://live.bilibili.com/h5/${_liveRoomController.roomId}',
off: true,
);
},
icon: const Icon(Icons.open_in_browser)),
],
),
);
} else {
return const SizedBox();
}
},
),
), ),
); );