mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-26 12:07:11 +08:00
lint
opt pages Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -155,12 +155,15 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
future: _futureBuilderFuture,
|
||||
builder: (BuildContext context, AsyncSnapshot snapshot) {
|
||||
if (snapshot.hasData && snapshot.data['status']) {
|
||||
final roomInfoH5 = _liveRoomController.roomInfoH5.value;
|
||||
return PLVideoPlayer(
|
||||
key: playerKey,
|
||||
fill: fill,
|
||||
alignment: alignment,
|
||||
plPlayerController: plPlayerController,
|
||||
headerControl: LiveHeaderControl(
|
||||
title: roomInfoH5?.roomInfo?.title,
|
||||
upName: roomInfoH5?.anchorInfo?.baseInfo?.uname,
|
||||
plPlayerController: plPlayerController,
|
||||
onSendDanmaku: onSendDanmaku,
|
||||
),
|
||||
@@ -485,12 +488,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
color: isFullScreen ? Colors.black : null,
|
||||
width: isFullScreen ? Get.size.width : videoWidth,
|
||||
height: isFullScreen ? Get.size.height : Get.size.width * 9 / 16,
|
||||
child: MediaQuery.removePadding(
|
||||
removeTop: true,
|
||||
removeRight: true,
|
||||
context: context,
|
||||
child: videoPlayerPanel(fill: Colors.transparent),
|
||||
),
|
||||
child: videoPlayerPanel(fill: Colors.transparent),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
|
||||
@@ -102,7 +102,7 @@ class LiveRoomChat extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
TextSpan _buildMsg(obj) {
|
||||
TextSpan _buildMsg(dynamic obj) {
|
||||
dynamic emots = obj['emots'];
|
||||
dynamic uemote = obj['uemote'];
|
||||
List list = [
|
||||
|
||||
@@ -9,11 +9,15 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
|
||||
class LiveHeaderControl extends StatelessWidget {
|
||||
const LiveHeaderControl({
|
||||
required this.title,
|
||||
required this.upName,
|
||||
required this.plPlayerController,
|
||||
required this.onSendDanmaku,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String? title;
|
||||
final String? upName;
|
||||
final PlPlayerController plPlayerController;
|
||||
final VoidCallback onSendDanmaku;
|
||||
|
||||
@@ -26,22 +30,41 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 14,
|
||||
title: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 42,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
tooltip: '发弹幕',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: onSendDanmaku,
|
||||
icon: const Icon(
|
||||
Icons.comment_outlined,
|
||||
size: 19,
|
||||
color: Colors.white,
|
||||
if (title != null)
|
||||
Expanded(
|
||||
child: Column(
|
||||
spacing: 5,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title!,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontSize: 15, height: 1, color: Colors.white),
|
||||
),
|
||||
if (plPlayerController.isFullScreen.value && upName != null)
|
||||
Text(
|
||||
upName!,
|
||||
maxLines: 1,
|
||||
style: const TextStyle(
|
||||
fontSize: 12, height: 1, color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
tooltip: '发弹幕',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: onSendDanmaku,
|
||||
icon: const Icon(
|
||||
Icons.comment_outlined,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
@@ -62,33 +85,28 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
if (Platform.isAndroid) ...[
|
||||
SizedBox(
|
||||
width: 34,
|
||||
height: 34,
|
||||
child: IconButton(
|
||||
tooltip: '画中画',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
var floating = Floating();
|
||||
if ((await floating.isPipAvailable) == true) {
|
||||
plPlayerController.hiddenControls(false);
|
||||
floating.enable(
|
||||
plPlayerController.direction.value == 'vertical'
|
||||
? const EnableManual(
|
||||
aspectRatio: Rational.vertical())
|
||||
: const EnableManual(),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.picture_in_picture_outlined,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
IconButton(
|
||||
tooltip: '画中画',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
try {
|
||||
var floating = Floating();
|
||||
if ((await floating.isPipAvailable) == true) {
|
||||
plPlayerController.hiddenControls(false);
|
||||
floating.enable(
|
||||
plPlayerController.direction.value == 'vertical'
|
||||
? const EnableManual(aspectRatio: Rational.vertical())
|
||||
: const EnableManual(),
|
||||
);
|
||||
}
|
||||
} catch (_) {}
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.picture_in_picture_outlined,
|
||||
size: 18,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
|
||||
Reference in New Issue
Block a user