mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
fix: 新增更多判空位置
This commit is contained in:
@@ -215,6 +215,10 @@ class AboutController extends GetxController {
|
||||
// 获取远程版本
|
||||
Future getRemoteApp() async {
|
||||
var result = await Request().get(Api.latestApp, extra: {'ua': 'pc'});
|
||||
if (result.data.isEmpty) {
|
||||
SmartDialog.showToast('检查更新失败,github接口未返回数据,请检查网络');
|
||||
return false;
|
||||
}
|
||||
data = LatestDataModel.fromJson(result.data[0]);
|
||||
remoteAppInfo = data;
|
||||
remoteVersion.value = data.tagName!;
|
||||
|
||||
@@ -88,8 +88,12 @@ class HistoryController extends GetxController {
|
||||
// 观看历史暂停状态
|
||||
Future historyStatus() async {
|
||||
var res = await UserHttp.historyStatus();
|
||||
pauseStatus.value = res.data['data'];
|
||||
localCache.put(LocalCacheKey.historyPause, res.data['data']);
|
||||
if (res['status']) {
|
||||
pauseStatus.value = res['data'];
|
||||
localCache.put(LocalCacheKey.historyPause, res['data']);
|
||||
} else {
|
||||
SmartDialog.showToast(res['msg']);
|
||||
}
|
||||
}
|
||||
|
||||
// 清空观看历史
|
||||
|
||||
@@ -44,9 +44,7 @@ class _LiveRoomPageState extends State<LiveRoomPage> {
|
||||
@override
|
||||
void dispose() {
|
||||
plPlayerController!.dispose();
|
||||
if (floating != null) {
|
||||
floating!.dispose();
|
||||
}
|
||||
floating?.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:PiliPalaX/common/widgets/network_img_layer.dart';
|
||||
import 'package:PiliPalaX/models/live/item.dart';
|
||||
|
||||
@@ -218,9 +218,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
||||
fullScreenStatusListener.cancel();
|
||||
plPlayerController!.dispose();
|
||||
}
|
||||
if (videoDetailController.floating != null) {
|
||||
videoDetailController.floating!.dispose();
|
||||
}
|
||||
videoDetailController.floating?.dispose();
|
||||
videoPlayerServiceHandler.onVideoDetailDispose();
|
||||
floating.dispose();
|
||||
_lifecycleListener.dispose();
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'dart:math';
|
||||
|
||||
import 'package:floating/floating.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -1204,13 +1203,9 @@ class _HeaderControlState extends State<HeaderControl> {
|
||||
padding: MaterialStateProperty.all(EdgeInsets.zero),
|
||||
),
|
||||
onPressed: () async {
|
||||
bool canUsePiP = false;
|
||||
bool canUsePiP = widget.floating != null &&
|
||||
await widget.floating!.isPipAvailable;
|
||||
widget.controller!.hiddenControls(false);
|
||||
try {
|
||||
canUsePiP = await widget.floating!.isPipAvailable;
|
||||
} on PlatformException catch (_) {
|
||||
canUsePiP = false;
|
||||
}
|
||||
if (canUsePiP) {
|
||||
final Rational aspectRatio = Rational(
|
||||
widget.videoDetailCtr!.data.dash!.video!.first.width!,
|
||||
|
||||
Reference in New Issue
Block a user