feat: 简介默认展开

This commit is contained in:
guozhigq
2024-10-19 22:59:55 +08:00
parent bb2d5e5494
commit 83c9ce55c8
4 changed files with 15 additions and 1 deletions

View File

@ -183,6 +183,14 @@ class _ExtraSettingState extends State<ExtraSetting> {
setKey: SettingBoxKey.enableAi,
defaultVal: true,
),
SetSwitchItem(
title: '视频简介默认展开',
setKey: SettingBoxKey.enableAutoExpand,
defaultVal: false,
callFn: (val) {
GlobalDataCache().enableAutoExpand = val;
},
),
const SetSwitchItem(
title: '相关视频推荐',
subTitle: '视频详情页推荐相关视频',

View File

@ -169,7 +169,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
owner = widget.videoDetail!.owner;
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
_expandableCtr = ExpandableController(initialExpanded: false);
_expandableCtr = ExpandableController(
initialExpanded: GlobalDataCache().enableAutoExpand);
}
// 收藏

View File

@ -49,6 +49,8 @@ class GlobalDataCache {
late List historyCacheList;
//
late bool enableSearchSuggest = true;
// 简介默认展开
late bool enableAutoExpand = false;
// 私有构造函数
GlobalDataCache._();
@ -112,5 +114,7 @@ class GlobalDataCache {
historyCacheList = localCache.get('cacheList', defaultValue: []);
enableSearchSuggest =
setting.get(SettingBoxKey.enableSearchSuggest, defaultValue: true);
enableAutoExpand =
setting.get(SettingBoxKey.enableAutoExpand, defaultValue: false);
}
}

View File

@ -113,6 +113,7 @@ class SettingBoxKey {
enableSearchWord = 'enableSearchWord',
enableSystemProxy = 'enableSystemProxy',
enableAi = 'enableAi',
enableAutoExpand = 'enableAutoExpand',
defaultHomePage = 'defaultHomePage',
enableRelatedVideo = 'enableRelatedVideo';