mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: 为全屏和离开添加mounted限制
This commit is contained in:
@@ -99,7 +99,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
onUserLeaveHintListener.setMethodCallHandler((call) async {
|
onUserLeaveHintListener.setMethodCallHandler((call) async {
|
||||||
if (call.method == 'onUserLeaveHint') {
|
if (call.method == 'onUserLeaveHint') {
|
||||||
if (autoPiP) {
|
if (autoPiP) {
|
||||||
autoEnterPip();
|
autoEnterPip();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -202,9 +202,10 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
videoDetailController.hiddenReplyReplyPanel();
|
videoDetailController.hiddenReplyReplyPanel();
|
||||||
hideStatusBar();
|
hideStatusBar();
|
||||||
}
|
}
|
||||||
setState(() {
|
isFullScreen.value = status;
|
||||||
isFullScreen.value = status;
|
if (mounted) {
|
||||||
});
|
setState(() {});
|
||||||
|
}
|
||||||
if (!status) {
|
if (!status) {
|
||||||
showStatusBar();
|
showStatusBar();
|
||||||
if (horizontalScreen) {
|
if (horizontalScreen) {
|
||||||
@@ -250,13 +251,20 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
fullScreenStatusListener.cancel();
|
fullScreenStatusListener.cancel();
|
||||||
plPlayerController!.pause();
|
plPlayerController!.pause();
|
||||||
}
|
}
|
||||||
setState(() => isShowing = false);
|
isShowing = false;
|
||||||
|
if (mounted) {
|
||||||
|
setState(() => {});
|
||||||
|
}
|
||||||
super.didPushNext();
|
super.didPushNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
// 返回当前页面时
|
// 返回当前页面时
|
||||||
void didPopNext() async {
|
void didPopNext() async {
|
||||||
|
isShowing = true;
|
||||||
|
if (mounted) {
|
||||||
|
setState(() => {});
|
||||||
|
}
|
||||||
videoDetailController.isFirstTime = false;
|
videoDetailController.isFirstTime = false;
|
||||||
final bool autoplay = autoPlayEnable;
|
final bool autoplay = autoPlayEnable;
|
||||||
videoDetailController.playerInit(autoplay: autoplay);
|
videoDetailController.playerInit(autoplay: autoplay);
|
||||||
@@ -274,7 +282,6 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
if (plPlayerController != null) {
|
if (plPlayerController != null) {
|
||||||
listenFullScreenStatus();
|
listenFullScreenStatus();
|
||||||
}
|
}
|
||||||
setState(() => isShowing = true);
|
|
||||||
super.didPopNext();
|
super.didPopNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,7 +73,11 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
.videoDetailCtr!.plPlayerController.isFullScreen
|
.videoDetailCtr!.plPlayerController.isFullScreen
|
||||||
.listen((bool status) {
|
.listen((bool status) {
|
||||||
isFullScreen = status;
|
isFullScreen = status;
|
||||||
setState(() {});
|
|
||||||
|
/// TODO setState() called after dispose()
|
||||||
|
if (mounted) {
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user