mod: 直播间背景图片

This commit is contained in:
guozhigq
2024-02-24 17:37:14 +08:00
parent cb0ff334b3
commit 4da6667b81
2 changed files with 45 additions and 39 deletions

View File

@ -104,7 +104,9 @@ class NetworkImgLayer extends StatelessWidget {
? 0 ? 0
: StyleString.imgRadius.x), : StyleString.imgRadius.x),
), ),
child: Center( child: type == 'bg'
? const SizedBox()
: Center(
child: Image.asset( child: Image.asset(
type == 'avatar' type == 'avatar'
? 'assets/images/noface.jpeg' ? 'assets/images/noface.jpeg'

View File

@ -75,39 +75,43 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
backgroundColor: Colors.black, backgroundColor: Colors.black,
body: Stack( body: Stack(
children: [ children: [
// Obx( Positioned(
// () => Positioned.fill( left: 0,
// child: Opacity( right: 0,
// opacity: 0.8, bottom: 0,
// child: _liveRoomController
// .roomInfoH5.value.roomInfo?.appBackground !=
// '' &&
// _liveRoomController
// .roomInfoH5.value.roomInfo?.appBackground !=
// null
// ? NetworkImgLayer(
// width: Get.width,
// height: Get.height,
// src: _liveRoomController
// .roomInfoH5.value.roomInfo?.appBackground ??
// '',
// )
// : Image.asset(
// 'assets/images/live/default_bg.webp',
// width: Get.width,
// height: Get.height,
// ),
// ),
// ),
// ),
Positioned.fill(
child: Opacity( child: Opacity(
opacity: 0.8, opacity: 0.8,
child: Image.asset( child: Image.asset(
'assets/images/live/default_bg.webp', 'assets/images/live/default_bg.webp',
fit: BoxFit.cover,
// width: Get.width,
// height: Get.height,
),
),
),
Obx(
() => Positioned(
left: 0,
right: 0,
bottom: 0,
child: _liveRoomController
.roomInfoH5.value.roomInfo?.appBackground !=
'' &&
_liveRoomController
.roomInfoH5.value.roomInfo?.appBackground !=
null
? Opacity(
opacity: 0.8,
child: NetworkImgLayer(
width: Get.width, width: Get.width,
height: Get.height, height: Get.height,
type: 'bg',
src: _liveRoomController
.roomInfoH5.value.roomInfo?.appBackground ??
'',
), ),
)
: const SizedBox(),
), ),
), ),
Column( Column(