feat: 简介默认展开
This commit is contained in:
@ -183,6 +183,14 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
setKey: SettingBoxKey.enableAi,
|
setKey: SettingBoxKey.enableAi,
|
||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
),
|
),
|
||||||
|
SetSwitchItem(
|
||||||
|
title: '视频简介默认展开',
|
||||||
|
setKey: SettingBoxKey.enableAutoExpand,
|
||||||
|
defaultVal: false,
|
||||||
|
callFn: (val) {
|
||||||
|
GlobalDataCache().enableAutoExpand = val;
|
||||||
|
},
|
||||||
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '相关视频推荐',
|
title: '相关视频推荐',
|
||||||
subTitle: '视频详情页推荐相关视频',
|
subTitle: '视频详情页推荐相关视频',
|
||||||
|
|||||||
@ -169,7 +169,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
|
|
||||||
owner = widget.videoDetail!.owner;
|
owner = widget.videoDetail!.owner;
|
||||||
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
|
enableAi = setting.get(SettingBoxKey.enableAi, defaultValue: true);
|
||||||
_expandableCtr = ExpandableController(initialExpanded: false);
|
_expandableCtr = ExpandableController(
|
||||||
|
initialExpanded: GlobalDataCache().enableAutoExpand);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 收藏
|
// 收藏
|
||||||
|
|||||||
@ -49,6 +49,8 @@ class GlobalDataCache {
|
|||||||
late List historyCacheList;
|
late List historyCacheList;
|
||||||
//
|
//
|
||||||
late bool enableSearchSuggest = true;
|
late bool enableSearchSuggest = true;
|
||||||
|
// 简介默认展开
|
||||||
|
late bool enableAutoExpand = false;
|
||||||
|
|
||||||
// 私有构造函数
|
// 私有构造函数
|
||||||
GlobalDataCache._();
|
GlobalDataCache._();
|
||||||
@ -112,5 +114,7 @@ class GlobalDataCache {
|
|||||||
historyCacheList = localCache.get('cacheList', defaultValue: []);
|
historyCacheList = localCache.get('cacheList', defaultValue: []);
|
||||||
enableSearchSuggest =
|
enableSearchSuggest =
|
||||||
setting.get(SettingBoxKey.enableSearchSuggest, defaultValue: true);
|
setting.get(SettingBoxKey.enableSearchSuggest, defaultValue: true);
|
||||||
|
enableAutoExpand =
|
||||||
|
setting.get(SettingBoxKey.enableAutoExpand, defaultValue: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,6 +113,7 @@ class SettingBoxKey {
|
|||||||
enableSearchWord = 'enableSearchWord',
|
enableSearchWord = 'enableSearchWord',
|
||||||
enableSystemProxy = 'enableSystemProxy',
|
enableSystemProxy = 'enableSystemProxy',
|
||||||
enableAi = 'enableAi',
|
enableAi = 'enableAi',
|
||||||
|
enableAutoExpand = 'enableAutoExpand',
|
||||||
defaultHomePage = 'defaultHomePage',
|
defaultHomePage = 'defaultHomePage',
|
||||||
enableRelatedVideo = 'enableRelatedVideo';
|
enableRelatedVideo = 'enableRelatedVideo';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user