mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-02 00:58:19 +08:00
mod: page observer
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -65,12 +65,19 @@ class _MainAppState extends State<MainApp>
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void didPopNext() {
|
void didPopNext() {
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
_mainController.checkUnreadDynamic();
|
_mainController.checkUnreadDynamic();
|
||||||
_checkDefaultSearch(true);
|
_checkDefaultSearch(true);
|
||||||
_checkUnread(context.orientation == Orientation.portrait);
|
_checkUnread(context.orientation == Orientation.portrait);
|
||||||
super.didPopNext();
|
super.didPopNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void didPushNext() {
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
super.didPushNext();
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
if (state == AppLifecycleState.resumed) {
|
if (state == AppLifecycleState.resumed) {
|
||||||
|
|||||||
@@ -1003,7 +1003,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
case 1:
|
case 1:
|
||||||
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
final List<InlineSpan> spanChildren = <InlineSpan>[];
|
||||||
final RegExp urlRegExp = RegExp(
|
final RegExp urlRegExp = RegExp(
|
||||||
'${Constants.urlPattern}|av\\d+|bv\\S+\\b',
|
'${Constants.urlPattern}|av\\d+|bv[a-z\\d]{10}',
|
||||||
caseSensitive: false,
|
caseSensitive: false,
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -1030,7 +1030,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
spanChildren.add(TextSpan(text: matchStr));
|
spanChildren.add(TextSpan(text: matchStr));
|
||||||
}
|
}
|
||||||
} else if (RegExp(r'^bv\S+\b$', caseSensitive: false)
|
} else if (RegExp(r'^bv[a-z\d]{10}$', caseSensitive: false)
|
||||||
.hasMatch(matchStr)) {
|
.hasMatch(matchStr)) {
|
||||||
try {
|
try {
|
||||||
// validate
|
// validate
|
||||||
|
|||||||
@@ -393,6 +393,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
|
|
||||||
ScreenBrightness().resetApplicationScreenBrightness();
|
ScreenBrightness().resetApplicationScreenBrightness();
|
||||||
|
|
||||||
videoDetailController.positionSubscription?.cancel();
|
videoDetailController.positionSubscription?.cancel();
|
||||||
@@ -426,6 +428,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WidgetsBinding.instance.addObserver(this);
|
||||||
|
|
||||||
if (videoDetailController.plPlayerController.playerStatus.status.value ==
|
if (videoDetailController.plPlayerController.playerStatus.status.value ==
|
||||||
PlayerStatus.playing &&
|
PlayerStatus.playing &&
|
||||||
videoDetailController.playerStatus != PlayerStatus.playing) {
|
videoDetailController.playerStatus != PlayerStatus.playing) {
|
||||||
|
|||||||
Reference in New Issue
Block a user