mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-18 16:16:14 +08:00
opt live room
tweak Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -35,7 +35,7 @@ class DanmakuHttp {
|
||||
//'aid': aid,
|
||||
'bvid': bvid,
|
||||
'progress': progress,
|
||||
'color': colorful == true ? null : color,
|
||||
'color': colorful == true ? 16777215 : color,
|
||||
'fontsize': fontsize,
|
||||
'pool': pool,
|
||||
'rnd': DateTime.now().microsecondsSinceEpoch,
|
||||
|
||||
@@ -91,26 +91,7 @@ class LiveRoomController extends GetxController {
|
||||
if (res['status']) {
|
||||
RoomPlayInfoData data = res['data'];
|
||||
if (data.liveStatus != 1) {
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
title: const Text('当前直播间未开播'),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: Get.theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get
|
||||
..back()
|
||||
..back(),
|
||||
child: const Text('退出'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
_dialog(title: '当前直播间未开播');
|
||||
return;
|
||||
}
|
||||
isPortrait.value = data.isPortrait ?? false;
|
||||
@@ -145,8 +126,37 @@ class LiveRoomController extends GetxController {
|
||||
roomId,
|
||||
heroTag,
|
||||
);
|
||||
} else {
|
||||
if (res['msg'] != null) {
|
||||
_dialog(title: res['msg']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _dialog({
|
||||
required String title,
|
||||
}) {
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
title: Text(title),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: Get.theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => Get
|
||||
..back()
|
||||
..back(),
|
||||
child: const Text('退出'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LiveMessageStream? msgStream;
|
||||
final ScrollController scrollController = ScrollController();
|
||||
|
||||
@@ -370,27 +370,28 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
RoomInfoH5Data? roomInfoH5 = _liveRoomController.roomInfoH5.value;
|
||||
return roomInfoH5 == null
|
||||
? const SizedBox.shrink()
|
||||
: Row(
|
||||
: GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () =>
|
||||
Get.toNamed('/member?mid=${roomInfoH5.roomInfo?.uid}'),
|
||||
child: Row(
|
||||
spacing: 10,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () => Get.toNamed(
|
||||
'/member?mid=${roomInfoH5.roomInfo?.uid}'),
|
||||
child: NetworkImgLayer(
|
||||
NetworkImgLayer(
|
||||
width: 34,
|
||||
height: 34,
|
||||
type: ImageType.avatar,
|
||||
src: roomInfoH5.anchorInfo!.baseInfo!.face,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
spacing: 1,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
roomInfoH5.anchorInfo!.baseInfo!.uname!,
|
||||
style: const TextStyle(fontSize: 14),
|
||||
),
|
||||
const SizedBox(height: 1),
|
||||
if (roomInfoH5.watchedShow?.textLarge?.isNotEmpty ==
|
||||
true)
|
||||
Text(
|
||||
@@ -400,6 +401,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -47,7 +47,13 @@ class BottomControl extends StatelessWidget {
|
||||
),
|
||||
const Spacer(),
|
||||
Obx(
|
||||
() => IconButton(
|
||||
() => SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () {
|
||||
plPlayerController.isOpenDanmu.value =
|
||||
!plPlayerController.isOpenDanmu.value;
|
||||
@@ -63,6 +69,7 @@ class BottomControl extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => Container(
|
||||
height: 30,
|
||||
|
||||
@@ -30,6 +30,7 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
automaticallyImplyLeading: false,
|
||||
titleSpacing: 14,
|
||||
title: Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
if (title != null)
|
||||
Expanded(
|
||||
@@ -55,7 +56,10 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
)
|
||||
else
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
tooltip: '发弹幕',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
@@ -67,9 +71,16 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => IconButton(
|
||||
() => SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
onPressed: plPlayerController.setOnlyPlayAudio,
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
icon: plPlayerController.onlyPlayAudio.value
|
||||
? const Icon(
|
||||
size: 18,
|
||||
@@ -83,9 +94,12 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
if (Platform.isAndroid) ...[
|
||||
IconButton(
|
||||
),
|
||||
if (Platform.isAndroid)
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
tooltip: '画中画',
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
@@ -97,7 +111,8 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
plPlayerController.hiddenControls(false);
|
||||
floating.enable(
|
||||
plPlayerController.direction.value == 'vertical'
|
||||
? const EnableManual(aspectRatio: Rational.vertical())
|
||||
? const EnableManual(
|
||||
aspectRatio: Rational.vertical())
|
||||
: const EnableManual(),
|
||||
);
|
||||
}
|
||||
@@ -109,9 +124,14 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
],
|
||||
IconButton(
|
||||
),
|
||||
SizedBox(
|
||||
width: 35,
|
||||
height: 35,
|
||||
child: IconButton(
|
||||
style: ButtonStyle(
|
||||
padding: WidgetStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () => PageUtils.scheduleExit(
|
||||
context,
|
||||
plPlayerController.isFullScreen.value,
|
||||
@@ -123,6 +143,7 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -8,9 +8,11 @@ import 'package:PiliPlus/models/common/msg/msg_unread_type.dart';
|
||||
import 'package:PiliPlus/models/common/nav_bar_config.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class MainController extends GetxController {
|
||||
class MainController extends GetxController
|
||||
with GetSingleTickerProviderStateMixin {
|
||||
List<NavigationBarType> navigationBars = <NavigationBarType>[];
|
||||
RxInt dynCount = 0.obs;
|
||||
|
||||
@@ -44,6 +46,14 @@ class MainController extends GetxController {
|
||||
|
||||
setNavBarConfig();
|
||||
|
||||
controller = mainTabBarView
|
||||
? TabController(
|
||||
vsync: this,
|
||||
initialIndex: selectedIndex.value,
|
||||
length: navigationBars.length,
|
||||
)
|
||||
: PageController(initialPage: selectedIndex.value);
|
||||
|
||||
hideTabBar =
|
||||
GStorage.setting.get(SettingBoxKey.hideTabBar, defaultValue: true);
|
||||
if (navigationBars.length > 1 && hideTabBar) {
|
||||
@@ -174,6 +184,7 @@ class MainController extends GetxController {
|
||||
@override
|
||||
void onClose() {
|
||||
bottomBarStream?.close();
|
||||
controller.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ class MainApp extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _MainAppState extends State<MainApp>
|
||||
with SingleTickerProviderStateMixin, RouteAware, WidgetsBindingObserver {
|
||||
with RouteAware, WidgetsBindingObserver {
|
||||
final MainController _mainController = Get.put(MainController());
|
||||
late final _homeController = Get.put(HomeController());
|
||||
late final _dynamicController = Get.put(DynamicsController());
|
||||
@@ -50,13 +50,6 @@ class _MainAppState extends State<MainApp>
|
||||
void initState() {
|
||||
super.initState();
|
||||
_lastSelectTime = DateTime.now().millisecondsSinceEpoch;
|
||||
_mainController.controller = _mainController.mainTabBarView
|
||||
? TabController(
|
||||
vsync: this,
|
||||
initialIndex: _mainController.selectedIndex.value,
|
||||
length: _mainController.navigationBars.length,
|
||||
)
|
||||
: PageController(initialPage: _mainController.selectedIndex.value);
|
||||
enableMYBar =
|
||||
GStorage.setting.get(SettingBoxKey.enableMYBar, defaultValue: true);
|
||||
useSideBar =
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/models_new/space/space/tab2.dart';
|
||||
import 'package:PiliPlus/pages/common/common_data_controller.dart';
|
||||
import 'package:PiliPlus/pages/member/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class MemberContributeCtr extends CommonDataController
|
||||
class MemberContributeCtr extends GetxController
|
||||
with GetSingleTickerProviderStateMixin {
|
||||
MemberContributeCtr({
|
||||
required this.heroTag,
|
||||
@@ -49,11 +47,6 @@ class MemberContributeCtr extends CommonDataController
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Future<LoadingState> customGetData() {
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
tabController?.dispose();
|
||||
|
||||
@@ -1451,6 +1451,7 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
if (_shouldShowSeasonPanel) '播放列表',
|
||||
];
|
||||
if (videoDetailController.tabCtr.length != tabs.length) {
|
||||
videoDetailController.tabCtr.dispose();
|
||||
videoDetailController.tabCtr = TabController(
|
||||
vsync: this,
|
||||
length: tabs.length,
|
||||
|
||||
Reference in New Issue
Block a user