From 327044d17c0613ebb998e59946c92004e08430ca Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 7 Oct 2024 09:40:11 +0800 Subject: [PATCH] mod: pass tag --- lib/pages/video/detail/introduction/controller.dart | 4 +++- lib/pages/video/detail/introduction/view.dart | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pages/video/detail/introduction/controller.dart b/lib/pages/video/detail/introduction/controller.dart index 96e85d54..8b62d0b9 100644 --- a/lib/pages/video/detail/introduction/controller.dart +++ b/lib/pages/video/detail/introduction/controller.dart @@ -86,7 +86,9 @@ class VideoIntroController extends GetxController { super.onInit(); userInfo = userInfoCache.get('userInfoCache'); try { - heroTag = Get.arguments['heroTag']; + if (heroTag.isEmpty) { + heroTag = Get.arguments['heroTag']; + } bvid = Get.parameters['bvid']!; } catch (_) {} if (Get.arguments.isNotEmpty) { diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index 53698485..a73ff61b 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -61,7 +61,8 @@ class _VideoIntroPanelState extends State // heroTag = Get.arguments['heroTag']; // } heroTag = widget.heroTag; - videoIntroController = Get.put(VideoIntroController(), tag: heroTag); + videoIntroController = Get.put(VideoIntroController(), tag: heroTag) + ..heroTag = heroTag; // _futureBuilderFuture = videoIntroController.queryVideoIntro(); videoIntroController.videoDetail.listen((value) { videoDetail = value;