mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-22 01:56:47 +08:00
fix live room
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -22,7 +22,7 @@ import 'package:cached_network_image/cached_network_image.dart';
|
|||||||
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||||
import 'package:floating/floating.dart';
|
import 'package:floating/floating.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart' show MethodChannel;
|
import 'package:flutter/services.dart' show MethodChannel, SystemUiOverlayStyle;
|
||||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:screen_brightness/screen_brightness.dart';
|
import 'package:screen_brightness/screen_brightness.dart';
|
||||||
@@ -207,57 +207,79 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SystemUiOverlayStyle _systemOverlayStyleForBrightness(
|
||||||
|
Brightness brightness, [
|
||||||
|
Color? backgroundColor,
|
||||||
|
]) {
|
||||||
|
final SystemUiOverlayStyle style = brightness == Brightness.dark
|
||||||
|
? SystemUiOverlayStyle.light
|
||||||
|
: SystemUiOverlayStyle.dark;
|
||||||
|
// For backward compatibility, create an overlay style without system navigation bar settings.
|
||||||
|
return SystemUiOverlayStyle(
|
||||||
|
statusBarColor: backgroundColor,
|
||||||
|
statusBarBrightness: style.statusBarBrightness,
|
||||||
|
statusBarIconBrightness: style.statusBarIconBrightness,
|
||||||
|
systemStatusBarContrastEnforced: style.systemStatusBarContrastEnforced,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget childWhenDisabled(bool isPortrait) {
|
Widget childWhenDisabled(bool isPortrait) {
|
||||||
return ColoredBox(
|
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||||
color: Colors.black,
|
value: _systemOverlayStyleForBrightness(
|
||||||
child: Stack(
|
Brightness.dark,
|
||||||
clipBehavior: Clip.none,
|
Theme.of(context).useMaterial3 ? const Color(0x00000000) : null,
|
||||||
children: [
|
),
|
||||||
Obx(
|
child: ColoredBox(
|
||||||
() => isFullScreen
|
color: Colors.black,
|
||||||
? const SizedBox.shrink()
|
child: Stack(
|
||||||
: Positioned.fill(
|
clipBehavior: Clip.none,
|
||||||
child: Opacity(
|
children: [
|
||||||
opacity: 0.6,
|
Obx(
|
||||||
child: _liveRoomController.roomInfoH5.value?.roomInfo
|
() => isFullScreen
|
||||||
?.appBackground?.isNotEmpty ==
|
? const SizedBox.shrink()
|
||||||
true
|
: Positioned.fill(
|
||||||
? CachedNetworkImage(
|
child: Opacity(
|
||||||
fit: BoxFit.cover,
|
opacity: 0.6,
|
||||||
width: Get.width,
|
child: _liveRoomController.roomInfoH5.value?.roomInfo
|
||||||
height: Get.height,
|
?.appBackground?.isNotEmpty ==
|
||||||
imageUrl: _liveRoomController.roomInfoH5.value!
|
true
|
||||||
.roomInfo!.appBackground!.http2https,
|
? CachedNetworkImage(
|
||||||
)
|
fit: BoxFit.cover,
|
||||||
: Image.asset(
|
width: Get.width,
|
||||||
'assets/images/live/default_bg.webp',
|
height: Get.height,
|
||||||
fit: BoxFit.cover,
|
imageUrl: _liveRoomController.roomInfoH5.value!
|
||||||
),
|
.roomInfo!.appBackground!.http2https,
|
||||||
|
)
|
||||||
|
: Image.asset(
|
||||||
|
'assets/images/live/default_bg.webp',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
SafeArea(
|
||||||
SafeArea(
|
top: !isFullScreen,
|
||||||
top: !isFullScreen,
|
left: !isFullScreen,
|
||||||
left: !isFullScreen,
|
right: !isFullScreen,
|
||||||
right: !isFullScreen,
|
bottom: false,
|
||||||
bottom: false,
|
child: isPortrait
|
||||||
child: isPortrait
|
? Obx(
|
||||||
? Obx(
|
() {
|
||||||
() {
|
if (_liveRoomController.isPortrait.value) {
|
||||||
if (_liveRoomController.isPortrait.value) {
|
return _buildPP;
|
||||||
return _buildPP;
|
}
|
||||||
}
|
return _buildPH;
|
||||||
return _buildPH;
|
},
|
||||||
},
|
)
|
||||||
)
|
: Column(
|
||||||
: Column(
|
children: [
|
||||||
children: [
|
Obx(() => _buildAppBar),
|
||||||
Obx(() => _buildAppBar),
|
_buildBodyH,
|
||||||
_buildBodyH,
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user