From 569cf6b4a3feb2983d8dea5a6a53886cba15ffa8 Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Tue, 24 Dec 2024 00:09:27 +0800 Subject: [PATCH] mod: auto expand intro panel Closes #47 Signed-off-by: bggRGjQaUbCoE --- lib/pages/video/detail/introduction/view.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index f7c1182a6..03cc353e8 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -171,9 +171,19 @@ class _VideoInfoState extends State with TickerProviderStateMixin { loadingStatus = widget.loadingStatus; enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true); + bool exapndIntroPanel = GStorage.exapndIntroPanel; + _expandableCtr = ExpandableController( - initialExpanded: GStorage.exapndIntroPanel, + initialExpanded: exapndIntroPanel, ); + + if (exapndIntroPanel.not) { + WidgetsBinding.instance.addPostFrameCallback((_) { + if (context.orientation == Orientation.landscape) { + _expandableCtr.toggle(); + } + }); + } } @override