From a8d40b4aeaea23aa53d4d58351ea9b869aed4a4b Mon Sep 17 00:00:00 2001 From: bggRGjQaUbCoE Date: Mon, 23 Dec 2024 18:03:01 +0800 Subject: [PATCH] feat: custom expand intro panel Signed-off-by: bggRGjQaUbCoE --- lib/pages/setting/extra_setting.dart | 6 ++++++ lib/pages/video/detail/introduction/view.dart | 6 +++++- lib/utils/storage.dart | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/pages/setting/extra_setting.dart b/lib/pages/setting/extra_setting.dart index c3b3aa02..bf2f48c8 100644 --- a/lib/pages/setting/extra_setting.dart +++ b/lib/pages/setting/extra_setting.dart @@ -229,6 +229,12 @@ class _ExtraSettingState extends State { setKey: SettingBoxKey.showRelatedVideo, defaultVal: true, ), + SetSwitchItem( + title: '默认展开视频简介', + leading: Icon(Icons.expand_more), + setKey: SettingBoxKey.exapndIntroPanel, + defaultVal: false, + ), Obx( () => ListTile( enableFeedback: true, diff --git a/lib/pages/video/detail/introduction/view.dart b/lib/pages/video/detail/introduction/view.dart index f7c6a730..209a413a 100644 --- a/lib/pages/video/detail/introduction/view.dart +++ b/lib/pages/video/detail/introduction/view.dart @@ -158,7 +158,7 @@ class _VideoInfoState extends State with TickerProviderStateMixin { late final _coinKey = GlobalKey(); late final _favKey = GlobalKey(); - final _expandableCtr = ExpandableController(initialExpanded: false); + late final ExpandableController _expandableCtr; @override void initState() { @@ -170,6 +170,10 @@ class _VideoInfoState extends State with TickerProviderStateMixin { loadingStatus = widget.loadingStatus; enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true); + + _expandableCtr = ExpandableController( + initialExpanded: GStorage.exapndIntroPanel, + ); } @override diff --git a/lib/utils/storage.dart b/lib/utils/storage.dart index 7cf792d8..4be3c71f 100644 --- a/lib/utils/storage.dart +++ b/lib/utils/storage.dart @@ -116,6 +116,15 @@ class GStorage { static bool get showRelatedVideo => setting.get(SettingBoxKey.showRelatedVideo, defaultValue: true); + static bool get showVideoReply => + setting.get(SettingBoxKey.showVideoReply, defaultValue: true); + + static bool get showBangumiReply => + setting.get(SettingBoxKey.showBangumiReply, defaultValue: true); + + static bool get exapndIntroPanel => + setting.get(SettingBoxKey.exapndIntroPanel, defaultValue: false); + static List get dynamicDetailRatio => setting.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]); @@ -310,6 +319,9 @@ class SettingBoxKey { grpcReply = 'grpcReply', showViewPoints = 'showViewPoints', showRelatedVideo = 'showRelatedVideo', + showVideoReply = 'showVideoReply', + showBangumiReply = 'showBangumiReply', + exapndIntroPanel = 'exapndIntroPanel', // Sponsor Block enableSponsorBlock = 'enableSponsorBlock',