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,17 +104,19 @@ class NetworkImgLayer extends StatelessWidget {
? 0 ? 0
: StyleString.imgRadius.x), : StyleString.imgRadius.x),
), ),
child: Center( child: type == 'bg'
child: Image.asset( ? const SizedBox()
type == 'avatar' : Center(
? 'assets/images/noface.jpeg' child: Image.asset(
: 'assets/images/loading.png', type == 'avatar'
width: width, ? 'assets/images/noface.jpeg'
height: height, : 'assets/images/loading.png',
cacheWidth: width.cacheSize(context), width: width,
cacheHeight: height.cacheSize(context), height: height,
), cacheWidth: width.cacheSize(context),
), cacheHeight: height.cacheSize(context),
),
),
); );
} }
} }

View File

@ -75,41 +75,45 @@ 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',
width: Get.width, fit: BoxFit.cover,
height: Get.height, // 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,
height: Get.height,
type: 'bg',
src: _liveRoomController
.roomInfoH5.value.roomInfo?.appBackground ??
'',
),
)
: const SizedBox(),
),
),
Column( Column(
children: [ children: [
AppBar( AppBar(