feat: 增加设置项
This commit is contained in:
@ -247,7 +247,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
] else ...[
|
] else ...[
|
||||||
const SizedBox(height: 26)
|
const SizedBox(height: 24)
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -20,6 +20,8 @@ import 'package:pilipala/utils/storage.dart';
|
|||||||
class VideoHttp {
|
class VideoHttp {
|
||||||
static Box localCache = GStrorage.localCache;
|
static Box localCache = GStrorage.localCache;
|
||||||
static Box setting = GStrorage.setting;
|
static Box setting = GStrorage.setting;
|
||||||
|
static bool enableRcmdDynamic =
|
||||||
|
setting.get(SettingBoxKey.enableRcmdDynamic, defaultValue: true);
|
||||||
|
|
||||||
// 首页推荐视频
|
// 首页推荐视频
|
||||||
static Future rcmdVideoList({required int ps, required int freshIdx}) async {
|
static Future rcmdVideoList({required int ps, required int freshIdx}) async {
|
||||||
@ -73,6 +75,7 @@ class VideoHttp {
|
|||||||
for (var i in res.data['data']['items']) {
|
for (var i in res.data['data']['items']) {
|
||||||
// 屏蔽推广和拉黑用户
|
// 屏蔽推广和拉黑用户
|
||||||
if (i['card_goto'] != 'ad_av' &&
|
if (i['card_goto'] != 'ad_av' &&
|
||||||
|
(!enableRcmdDynamic ? i['card_goto'] != 'picture' : true) &&
|
||||||
(i['args'] != null &&
|
(i['args'] != null &&
|
||||||
!blackMidsList.contains(i['args']['up_mid']))) {
|
!blackMidsList.contains(i['args']['up_mid']))) {
|
||||||
list.add(RecVideoItemAppModel.fromJson(i));
|
list.add(RecVideoItemAppModel.fromJson(i));
|
||||||
|
|||||||
@ -27,7 +27,9 @@ class SSearchController extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
|
if (setting.get(SettingBoxKey.enableSearchWord, defaultValue: true)) {
|
||||||
searchDefault();
|
searchDefault();
|
||||||
|
}
|
||||||
// 其他页面跳转过来
|
// 其他页面跳转过来
|
||||||
if (Get.parameters.keys.isNotEmpty) {
|
if (Get.parameters.keys.isNotEmpty) {
|
||||||
if (Get.parameters['keyword'] != null) {
|
if (Get.parameters['keyword'] != null) {
|
||||||
|
|||||||
@ -55,6 +55,18 @@ class _ExtraSettingState extends State<ExtraSetting> {
|
|||||||
defaultVal: true,
|
defaultVal: true,
|
||||||
callFn: (val) => {SmartDialog.showToast('下次启动时生效')},
|
callFn: (val) => {SmartDialog.showToast('下次启动时生效')},
|
||||||
),
|
),
|
||||||
|
const SetSwitchItem(
|
||||||
|
title: '搜索默认词',
|
||||||
|
subTitle: '是否展示搜索框默认词',
|
||||||
|
setKey: SettingBoxKey.enableSearchWord,
|
||||||
|
defaultVal: true,
|
||||||
|
),
|
||||||
|
const SetSwitchItem(
|
||||||
|
title: '推荐动态',
|
||||||
|
subTitle: '是否在推荐内容中展示动态',
|
||||||
|
setKey: SettingBoxKey.enableRcmdDynamic,
|
||||||
|
defaultVal: true,
|
||||||
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '快速收藏',
|
title: '快速收藏',
|
||||||
subTitle: '点按收藏至默认,长按选择文件夹',
|
subTitle: '点按收藏至默认,长按选择文件夹',
|
||||||
|
|||||||
@ -113,6 +113,8 @@ class SettingBoxKey {
|
|||||||
static const String enableHotKey = 'enableHotKey';
|
static const String enableHotKey = 'enableHotKey';
|
||||||
static const String enableQuickFav = 'enableQuickFav';
|
static const String enableQuickFav = 'enableQuickFav';
|
||||||
static const String enableWordRe = 'enableWordRe';
|
static const String enableWordRe = 'enableWordRe';
|
||||||
|
static const String enableSearchWord = 'enableSearchWord';
|
||||||
|
static const String enableRcmdDynamic = 'enableRcmdDynamic';
|
||||||
|
|
||||||
/// 外观
|
/// 外观
|
||||||
static const String themeMode = 'themeMode';
|
static const String themeMode = 'themeMode';
|
||||||
|
|||||||
Reference in New Issue
Block a user