Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-06-21 12:46:34 +08:00
parent 5f3f158932
commit 604d78ad6a
161 changed files with 4873 additions and 4770 deletions

View File

@@ -1,5 +1,9 @@
enum DynamicBadgeMode { hidden, point, number }
enum DynamicBadgeMode {
hidden('隐藏'),
point('红点'),
number('数字'),
;
extension DynamicBadgeModeExt on DynamicBadgeMode {
String get description => const ['隐藏', '红点', '数字'][index];
final String desc;
const DynamicBadgeMode(this.desc);
}

View File

@@ -1,12 +1,11 @@
enum DynamicsTabType {
all,
video,
pgc,
article,
up,
}
all('全部'),
video('投稿'),
pgc('番剧'),
article('专栏'),
up('UP'),
;
extension DynamicsTabTypeExt on DynamicsTabType {
String get values => const ['all', 'video', 'pgc', 'article', 'up'][index];
String get labels => const ['全部', '投稿', '番剧', '专栏', 'UP'][index];
final String label;
const DynamicsTabType(this.label);
}

View File

@@ -1,5 +1,12 @@
enum MemberTabType { none, home, dynamic, contribute, favorite, bangumi }
enum MemberTabType {
def('默认'),
home('主页'),
dynamic('动态'),
contribute('投稿'),
favorite('收藏'),
bangumi('番剧'),
;
extension MemberTabTypeExt on MemberTabType {
String get title => const ['默认', '主页', '动态', '投稿', '收藏', '番剧'][index];
final String title;
const MemberTabType(this.title);
}

View File

@@ -1,27 +1,27 @@
enum MsgType {
invalid(value: 0, label: "空空的~"),
text(value: 1, label: "文本消息"),
pic(value: 2, label: "图片消息"),
audio(value: 3, label: "语音消息"),
share(value: 4, label: "分享消息"),
revoke(value: 5, label: "撤回消息"),
customFace(value: 6, label: "自定义表情"),
shareV2(value: 7, label: "分享v2消息"),
sysCancel(value: 8, label: "系统撤销"),
miniProgram(value: 9, label: "小程序"),
notifyMsg(value: 10, label: "业务通知"),
archiveCard(value: 11, label: "投稿卡片"),
articleCard(value: 12, label: "专栏卡片"),
picCard(value: 13, label: "图片卡片"),
commonShare(value: 14, label: "异形卡片"),
autoReplyPush(value: 16, label: "自动回复推送"),
notifyText(value: 18, label: "文本提示");
// enum MsgType {
// invalid(value: 0, label: "空空的~"),
// text(value: 1, label: "文本消息"),
// pic(value: 2, label: "图片消息"),
// audio(value: 3, label: "语音消息"),
// share(value: 4, label: "分享消息"),
// revoke(value: 5, label: "撤回消息"),
// customFace(value: 6, label: "自定义表情"),
// shareV2(value: 7, label: "分享v2消息"),
// sysCancel(value: 8, label: "系统撤销"),
// miniProgram(value: 9, label: "小程序"),
// notifyMsg(value: 10, label: "业务通知"),
// archiveCard(value: 11, label: "投稿卡片"),
// articleCard(value: 12, label: "专栏卡片"),
// picCard(value: 13, label: "图片卡片"),
// commonShare(value: 14, label: "异形卡片"),
// autoReplyPush(value: 16, label: "自动回复推送"),
// notifyText(value: 18, label: "文本提示");
final int value;
final String label;
const MsgType({required this.value, required this.label});
static MsgType parse(int value) {
return MsgType.values
.firstWhere((e) => e.value == value, orElse: () => MsgType.invalid);
}
}
// final int value;
// final String label;
// const MsgType({required this.value, required this.label});
// static MsgType parse(int value) {
// return MsgType.values
// .firstWhere((e) => e.value == value, orElse: () => MsgType.invalid);
// }
// }

View File

@@ -1,10 +1,14 @@
import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
enum ReplyOptionType { allow, close, choose }
enum ReplyOptionType {
allow('允许评论'),
close('关闭评论'),
choose('精选评论'),
;
extension ReplyOptionTypeExt on ReplyOptionType {
String get title => const ['允许评论', '关闭评论', '精选评论'][index];
final String title;
const ReplyOptionType(this.title);
IconData get iconData => switch (this) {
ReplyOptionType.allow => MdiIcons.commentTextOutline,

View File

@@ -1,6 +1,8 @@
enum ReplySortType { time, like }
enum ReplySortType {
time('最新评论', '最新'),
hot('最热评论', '最热');
extension ReplySortTypeExt on ReplySortType {
String get title => const ['最新评论', '最热评论'][index];
String get label => const ['最新', '最热'][index];
final String title;
final String label;
const ReplySortType(this.title, this.label);
}

View File

@@ -38,6 +38,6 @@ enum ArchiveFilterType {
// 专栏
// attention('最多喜欢'),
final String description;
const ArchiveFilterType(this.description);
final String desc;
const ArchiveFilterType(this.desc);
}

View File

@@ -1 +1 @@
enum SettingsType { normal, sw1tch, divider }
enum SettingsType { normal, sw1tch }

View File

@@ -1,5 +1,10 @@
enum ActionType { skip, mute, full, poi }
enum ActionType {
skip('跳过'),
mute('静音'),
full('整个视频'),
poi('精彩时刻'),
;
extension ActionTypeExt on ActionType {
String get title => const ['跳过', '静音', '整个视频', '精彩时刻'][index];
final String title;
const ActionType(this.title);
}

View File

@@ -1,5 +1,11 @@
enum SkipType { alwaysSkip, skipOnce, skipManually, showOnly, disable }
enum SkipType {
alwaysSkip('总是跳过'),
skipOnce('跳过一次'),
skipManually('手动跳过'),
showOnly('仅显示'),
disable('禁用'),
;
extension SkipTypeExt on SkipType {
String get title => const ['总是跳过', '跳过一次', '手动跳过', '仅显示', '禁用'][index];
final String title;
const SkipType(this.title);
}

View File

@@ -2,15 +2,13 @@ import 'package:flutter/material.dart';
import 'package:material_design_icons_flutter/material_design_icons_flutter.dart';
enum ThemeType {
light,
dark,
system,
}
light('浅色'),
dark('深色'),
system('跟随系统'),
;
extension ThemeTypeExt on ThemeType {
String get description => const ['浅色', '深色', '跟随系统'][index];
int get code => index;
final String desc;
const ThemeType(this.desc);
ThemeMode get toThemeMode => switch (this) {
ThemeType.light => ThemeMode.light,

View File

@@ -6,9 +6,9 @@ enum AudioQuality {
hiRes(30251, 'Hi-Res无损');
final int code;
final String description;
final String desc;
const AudioQuality(this.code, this.description);
const AudioQuality(this.code, this.desc);
static final _codeMap = {for (var i in values) i.code: i};

View File

@@ -29,8 +29,8 @@ enum CDNService {
String get code => name;
static final fromCode = values.byName;
final String description;
final String desc;
final String host;
const CDNService(this.description, [this.host = '']);
const CDNService(this.desc, [this.host = '']);
}

View File

@@ -13,9 +13,9 @@ enum VideoQuality {
super8k(127, '8K 超高清');
final int code;
final String description;
final String desc;
const VideoQuality(this.code, this.description);
const VideoQuality(this.code, this.desc);
static final _codeMap = {for (var i in values) i.code: i};