feat: custom reply length limit

Closes #55

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-12-26 20:46:00 +08:00
parent 79da08b285
commit 81a23ea59d
5 changed files with 82 additions and 16 deletions

View File

@@ -1,10 +1,10 @@
class GlobalData {
int imgQuality = 10;
// int themeMode = 2;
bool grpcReply = true;
int replyLengthLimit = 6;
// 私有构造函数
GlobalData._();

View File

@@ -136,6 +136,12 @@ class GStorage {
static bool get horizontalMemberPage =>
setting.get(SettingBoxKey.horizontalMemberPage, defaultValue: false);
static int get replyLengthLimit =>
setting.get(SettingBoxKey.replyLengthLimit, defaultValue: 6);
static int get defaultPicQa =>
setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10);
static List<double> get dynamicDetailRatio =>
setting.get(SettingBoxKey.dynamicDetailRatio, defaultValue: [60.0, 40.0]);
@@ -203,15 +209,10 @@ class GStorage {
// 视频设置
video = await Hive.openBox('video');
// 设置全局变量
GlobalData().imgQuality = setting.get(
SettingBoxKey.defaultPicQa,
defaultValue: 10,
);
// GlobalData().themeMode = setting.get(
// SettingBoxKey.themeMode,
// defaultValue: ThemeType.system.code,
// );
GlobalData().grpcReply = grpcReply;
GlobalData()
..imgQuality = defaultPicQa
..grpcReply = grpcReply
..replyLengthLimit = replyLengthLimit;
}
static Future<String> exportAllSettings() async {
@@ -341,6 +342,7 @@ class SettingBoxKey {
exapndIntroPanelH = 'exapndIntroPanelH',
horizontalSeasonPanel = 'horizontalSeasonPanel',
horizontalMemberPage = 'horizontalMemberPage',
replyLengthLimit = 'replyLengthLimit',
// Sponsor Block
enableSponsorBlock = 'enableSponsorBlock',