diff --git a/lib/common/widgets/network_img_layer.dart b/lib/common/widgets/network_img_layer.dart index 03adc166..52c56a8a 100644 --- a/lib/common/widgets/network_img_layer.dart +++ b/lib/common/widgets/network_img_layer.dart @@ -104,17 +104,19 @@ class NetworkImgLayer extends StatelessWidget { ? 0 : StyleString.imgRadius.x), ), - child: Center( - child: Image.asset( - type == 'avatar' - ? 'assets/images/noface.jpeg' - : 'assets/images/loading.png', - width: width, - height: height, - cacheWidth: width.cacheSize(context), - cacheHeight: height.cacheSize(context), - ), - ), + child: type == 'bg' + ? const SizedBox() + : Center( + child: Image.asset( + type == 'avatar' + ? 'assets/images/noface.jpeg' + : 'assets/images/loading.png', + width: width, + height: height, + cacheWidth: width.cacheSize(context), + cacheHeight: height.cacheSize(context), + ), + ), ); } } diff --git a/lib/pages/live_room/view.dart b/lib/pages/live_room/view.dart index 39800b90..1e5c29c5 100644 --- a/lib/pages/live_room/view.dart +++ b/lib/pages/live_room/view.dart @@ -75,41 +75,45 @@ class _LiveRoomPageState extends State { backgroundColor: Colors.black, body: Stack( children: [ - // Obx( - // () => Positioned.fill( - // child: Opacity( - // opacity: 0.8, - // 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( + Positioned( + left: 0, + right: 0, + bottom: 0, child: Opacity( opacity: 0.8, child: Image.asset( 'assets/images/live/default_bg.webp', - width: Get.width, - height: Get.height, + 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, + height: Get.height, + type: 'bg', + src: _liveRoomController + .roomInfoH5.value.roomInfo?.appBackground ?? + '', + ), + ) + : const SizedBox(), + ), + ), Column( children: [ AppBar(