mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-22 11:41:09 +08:00
@@ -1,8 +1,7 @@
|
||||
enum DmBlockType {
|
||||
keyword('关键词'),
|
||||
regex('正则'),
|
||||
uid('用户'),
|
||||
;
|
||||
uid('用户');
|
||||
|
||||
final String label;
|
||||
const DmBlockType(this.label);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
enum DynamicBadgeMode {
|
||||
hidden('隐藏'),
|
||||
point('红点'),
|
||||
number('数字'),
|
||||
;
|
||||
number('数字');
|
||||
|
||||
final String desc;
|
||||
const DynamicBadgeMode(this.desc);
|
||||
|
||||
@@ -3,8 +3,7 @@ enum DynamicsTabType {
|
||||
video('投稿'),
|
||||
pgc('番剧'),
|
||||
article('专栏'),
|
||||
up('UP'),
|
||||
;
|
||||
up('UP');
|
||||
|
||||
final String label;
|
||||
const DynamicsTabType(this.label);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
enum FavOrderType {
|
||||
mtime('最近收藏'),
|
||||
view('最多播放'),
|
||||
pubtime('最近投稿'),
|
||||
;
|
||||
pubtime('最近投稿');
|
||||
|
||||
final String label;
|
||||
|
||||
|
||||
@@ -26,21 +26,21 @@ enum HomeTabType implements EnumWithLabel {
|
||||
const HomeTabType(this.label);
|
||||
|
||||
ScrollOrRefreshMixin Function() get ctr => switch (this) {
|
||||
HomeTabType.live => Get.find<LiveController>,
|
||||
HomeTabType.rcmd => Get.find<RcmdController>,
|
||||
HomeTabType.hot => Get.find<HotController>,
|
||||
HomeTabType.rank =>
|
||||
(Get.find<RankController>) as ScrollOrRefreshMixin Function(),
|
||||
HomeTabType.bangumi || HomeTabType.cinema => () =>
|
||||
Get.find<PgcController>(tag: name),
|
||||
};
|
||||
HomeTabType.live => Get.find<LiveController>,
|
||||
HomeTabType.rcmd => Get.find<RcmdController>,
|
||||
HomeTabType.hot => Get.find<HotController>,
|
||||
HomeTabType.rank =>
|
||||
(Get.find<RankController>) as ScrollOrRefreshMixin Function(),
|
||||
HomeTabType.bangumi ||
|
||||
HomeTabType.cinema => () => Get.find<PgcController>(tag: name),
|
||||
};
|
||||
|
||||
Widget get page => switch (this) {
|
||||
HomeTabType.live => const LivePage(),
|
||||
HomeTabType.rcmd => const RcmdPage(),
|
||||
HomeTabType.hot => const HotPage(),
|
||||
HomeTabType.rank => const RankPage(),
|
||||
HomeTabType.bangumi => const PgcPage(tabType: HomeTabType.bangumi),
|
||||
HomeTabType.cinema => const PgcPage(tabType: HomeTabType.cinema),
|
||||
};
|
||||
HomeTabType.live => const LivePage(),
|
||||
HomeTabType.rcmd => const RcmdPage(),
|
||||
HomeTabType.hot => const HotPage(),
|
||||
HomeTabType.rank => const RankPage(),
|
||||
HomeTabType.bangumi => const PgcPage(tabType: HomeTabType.bangumi),
|
||||
HomeTabType.cinema => const PgcPage(tabType: HomeTabType.cinema),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
|
||||
enum LaterViewType {
|
||||
all(0, '全部'),
|
||||
// toView(1, '未看'),
|
||||
unfinished(2, '未看完'),
|
||||
unfinished(2, '未看完')
|
||||
// viewed(3, '已看完'),
|
||||
;
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ enum MemberTabType {
|
||||
dynamic('动态'),
|
||||
contribute('投稿'),
|
||||
favorite('收藏'),
|
||||
bangumi('番剧'),
|
||||
;
|
||||
bangumi('番剧');
|
||||
|
||||
final String title;
|
||||
const MemberTabType(this.title);
|
||||
|
||||
@@ -4,15 +4,14 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
enum ReplyOptionType {
|
||||
allow('允许评论'),
|
||||
close('关闭评论'),
|
||||
choose('精选评论'),
|
||||
;
|
||||
choose('精选评论');
|
||||
|
||||
final String title;
|
||||
const ReplyOptionType(this.title);
|
||||
|
||||
IconData get iconData => switch (this) {
|
||||
ReplyOptionType.allow => MdiIcons.commentTextOutline,
|
||||
ReplyOptionType.close => MdiIcons.commentOffOutline,
|
||||
ReplyOptionType.choose => MdiIcons.commentProcessingOutline
|
||||
};
|
||||
ReplyOptionType.allow => MdiIcons.commentTextOutline,
|
||||
ReplyOptionType.close => MdiIcons.commentOffOutline,
|
||||
ReplyOptionType.choose => MdiIcons.commentProcessingOutline,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ enum ActionType {
|
||||
skip('跳过'),
|
||||
mute('静音'),
|
||||
full('整个视频'),
|
||||
poi('精彩时刻'),
|
||||
;
|
||||
poi('精彩时刻');
|
||||
|
||||
final String title;
|
||||
const ActionType(this.title);
|
||||
|
||||
@@ -14,7 +14,7 @@ enum SegmentType {
|
||||
music_offtopic,
|
||||
poi_highlight,
|
||||
filler,
|
||||
exclusive_access
|
||||
exclusive_access,
|
||||
}
|
||||
|
||||
// List<SegmentType> _actionType2SegmentType(ActionType actionType) {
|
||||
@@ -52,93 +52,93 @@ enum SegmentType {
|
||||
extension SegmentTypeExt on SegmentType {
|
||||
/// from https://github.com/hanydd/BilibiliSponsorBlock/blob/master/public/_locales/zh_CN/messages.json
|
||||
String get title => const [
|
||||
'赞助广告', //sponsor
|
||||
'无偿/自我推广', //selfpromo
|
||||
'三连/订阅提醒', //interaction
|
||||
'过场/开场动画', //intro
|
||||
'鸣谢/结束画面', //outro
|
||||
'回顾/概要', //preview
|
||||
'音乐:非音乐部分', //music_offtopic
|
||||
'精彩时刻/重点', //poi_highlight
|
||||
'离题闲聊/玩笑', //filler
|
||||
'柔性推广/品牌合作', //exclusive_access
|
||||
][index];
|
||||
'赞助广告', //sponsor
|
||||
'无偿/自我推广', //selfpromo
|
||||
'三连/订阅提醒', //interaction
|
||||
'过场/开场动画', //intro
|
||||
'鸣谢/结束画面', //outro
|
||||
'回顾/概要', //preview
|
||||
'音乐:非音乐部分', //music_offtopic
|
||||
'精彩时刻/重点', //poi_highlight
|
||||
'离题闲聊/玩笑', //filler
|
||||
'柔性推广/品牌合作', //exclusive_access
|
||||
][index];
|
||||
|
||||
String get shortTitle => const [
|
||||
'赞助广告', //sponsor
|
||||
'推广', //selfpromo
|
||||
'订阅提醒', //interaction
|
||||
'开场', //intro
|
||||
'片尾', //outro
|
||||
'预览', //preview
|
||||
'非音乐', //music_offtopic
|
||||
'精彩时刻', //poi_highlight
|
||||
'闲聊', //filler
|
||||
'品牌合作', //exclusive_access
|
||||
][index];
|
||||
'赞助广告', //sponsor
|
||||
'推广', //selfpromo
|
||||
'订阅提醒', //interaction
|
||||
'开场', //intro
|
||||
'片尾', //outro
|
||||
'预览', //preview
|
||||
'非音乐', //music_offtopic
|
||||
'精彩时刻', //poi_highlight
|
||||
'闲聊', //filler
|
||||
'品牌合作', //exclusive_access
|
||||
][index];
|
||||
|
||||
String get description => const [
|
||||
'付费推广、付费推荐和直接广告。不是自我推广或免费提及他们喜欢的商品/创作者/网站/产品。', //sponsor
|
||||
'类似于 “赞助广告” ,但无报酬或是自我推广。包括有关商品、捐赠的部分或合作者的信息。', //selfpromo
|
||||
'视频中间简短提醒观众来一键三连或关注。 如果片段较长,或是有具体内容,则应分类为自我推广。', //interaction
|
||||
'没有实际内容的间隔片段。可以是暂停、静态帧或重复动画。不适用于包含内容的过场。', //intro
|
||||
'致谢画面或片尾画面。不包含内容的结尾。', //outro
|
||||
'展示此视频或同系列视频将出现的画面集锦,片段中所有内容都将在之后的正片中再次出现。', //preview
|
||||
'仅用于音乐视频。此分类只能用于音乐视频中未包括于其他分类的部分。', //music_offtopic
|
||||
'大部分人都在寻找的空降时间。类似于“封面在12:34”的评论。', //poi_highlight
|
||||
"仅作为填充内容或增添趣味而添加的离题片段,这些内容对理解视频的主要内容并非必需。这不包括提供背景信息或上下文的片段。这是一个非常激进的分类,适用于当你不想看'娱乐性'内容的时候。", //filler
|
||||
'仅用于对整个视频进行标记。适用于展示UP主免费或获得补贴后使用的产品、服务或场地的视频。', //exclusive_access
|
||||
][index];
|
||||
'付费推广、付费推荐和直接广告。不是自我推广或免费提及他们喜欢的商品/创作者/网站/产品。', //sponsor
|
||||
'类似于 “赞助广告” ,但无报酬或是自我推广。包括有关商品、捐赠的部分或合作者的信息。', //selfpromo
|
||||
'视频中间简短提醒观众来一键三连或关注。 如果片段较长,或是有具体内容,则应分类为自我推广。', //interaction
|
||||
'没有实际内容的间隔片段。可以是暂停、静态帧或重复动画。不适用于包含内容的过场。', //intro
|
||||
'致谢画面或片尾画面。不包含内容的结尾。', //outro
|
||||
'展示此视频或同系列视频将出现的画面集锦,片段中所有内容都将在之后的正片中再次出现。', //preview
|
||||
'仅用于音乐视频。此分类只能用于音乐视频中未包括于其他分类的部分。', //music_offtopic
|
||||
'大部分人都在寻找的空降时间。类似于“封面在12:34”的评论。', //poi_highlight
|
||||
"仅作为填充内容或增添趣味而添加的离题片段,这些内容对理解视频的主要内容并非必需。这不包括提供背景信息或上下文的片段。这是一个非常激进的分类,适用于当你不想看'娱乐性'内容的时候。", //filler
|
||||
'仅用于对整个视频进行标记。适用于展示UP主免费或获得补贴后使用的产品、服务或场地的视频。', //exclusive_access
|
||||
][index];
|
||||
|
||||
Color get color => const [
|
||||
Color(0xFF00d400), //sponsor
|
||||
Color(0xFFffff00), //selfpromo
|
||||
Color(0xFFcc00ff), //interaction
|
||||
Color(0xFF00ffff), //intro
|
||||
Color(0xFF0202ed), //outro
|
||||
Color(0xFF008fd6), //preview
|
||||
Color(0xFFff9900), //music_offtopic
|
||||
Color(0xFFff1684), //poi_highlight
|
||||
Color(0xFF7300FF), //filler
|
||||
Color(0xFF008a5c), //exclusive_access
|
||||
][index];
|
||||
Color(0xFF00d400), //sponsor
|
||||
Color(0xFFffff00), //selfpromo
|
||||
Color(0xFFcc00ff), //interaction
|
||||
Color(0xFF00ffff), //intro
|
||||
Color(0xFF0202ed), //outro
|
||||
Color(0xFF008fd6), //preview
|
||||
Color(0xFFff9900), //music_offtopic
|
||||
Color(0xFFff1684), //poi_highlight
|
||||
Color(0xFF7300FF), //filler
|
||||
Color(0xFF008a5c), //exclusive_access
|
||||
][index];
|
||||
|
||||
List<ActionType> get toActionType {
|
||||
return switch (this) {
|
||||
SegmentType.sponsor => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full,
|
||||
],
|
||||
SegmentType.selfpromo => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
ActionType.full,
|
||||
],
|
||||
SegmentType.interaction => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.intro => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.outro => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.preview => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.music_offtopic => const [
|
||||
ActionType.skip,
|
||||
],
|
||||
ActionType.skip,
|
||||
],
|
||||
SegmentType.poi_highlight => const [ActionType.poi],
|
||||
SegmentType.filler => const [
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
ActionType.skip,
|
||||
ActionType.mute,
|
||||
],
|
||||
SegmentType.exclusive_access => const [ActionType.full],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3,8 +3,7 @@ enum SkipType {
|
||||
skipOnce('跳过一次'),
|
||||
skipManually('手动跳过'),
|
||||
showOnly('仅显示'),
|
||||
disable('禁用'),
|
||||
;
|
||||
disable('禁用');
|
||||
|
||||
final String title;
|
||||
const SkipType(this.title);
|
||||
|
||||
@@ -7,8 +7,7 @@ enum StatType {
|
||||
reply(Icons.comment_outlined),
|
||||
follow(Icons.favorite_border),
|
||||
play(Icons.play_circle_outlined),
|
||||
listen(Icons.headset_outlined),
|
||||
;
|
||||
listen(Icons.headset_outlined);
|
||||
|
||||
final IconData iconData;
|
||||
const StatType(this.iconData);
|
||||
|
||||
@@ -4,21 +4,20 @@ import 'package:material_design_icons_flutter/material_design_icons_flutter.dart
|
||||
enum ThemeType {
|
||||
light('浅色'),
|
||||
dark('深色'),
|
||||
system('跟随系统'),
|
||||
;
|
||||
system('跟随系统');
|
||||
|
||||
final String desc;
|
||||
const ThemeType(this.desc);
|
||||
|
||||
ThemeMode get toThemeMode => switch (this) {
|
||||
ThemeType.light => ThemeMode.light,
|
||||
ThemeType.dark => ThemeMode.dark,
|
||||
ThemeType.system => ThemeMode.system,
|
||||
};
|
||||
ThemeType.light => ThemeMode.light,
|
||||
ThemeType.dark => ThemeMode.dark,
|
||||
ThemeType.system => ThemeMode.system,
|
||||
};
|
||||
|
||||
Icon get icon => switch (this) {
|
||||
ThemeType.light => const Icon(MdiIcons.weatherSunny, size: 24),
|
||||
ThemeType.dark => const Icon(MdiIcons.weatherNight, size: 24),
|
||||
ThemeType.system => const Icon(MdiIcons.themeLightDark, size: 24),
|
||||
};
|
||||
ThemeType.light => const Icon(MdiIcons.weatherSunny, size: 24),
|
||||
ThemeType.dark => const Icon(MdiIcons.weatherNight, size: 24),
|
||||
ThemeType.system => const Icon(MdiIcons.themeLightDark, size: 24),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -29,12 +29,12 @@ extension LiveQualityExt on LiveQuality {
|
||||
}
|
||||
|
||||
String get description => const [
|
||||
'杜比',
|
||||
'4K',
|
||||
'原画',
|
||||
'蓝光',
|
||||
'超清',
|
||||
'高清',
|
||||
'流畅',
|
||||
][index];
|
||||
'杜比',
|
||||
'4K',
|
||||
'原画',
|
||||
'蓝光',
|
||||
'超清',
|
||||
'高清',
|
||||
'流畅',
|
||||
][index];
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ enum SubtitlePrefType { off, on, withoutAi, auto }
|
||||
|
||||
extension SubtitlePrefTypeExt on SubtitlePrefType {
|
||||
String get description => const [
|
||||
'默认不显示字幕',
|
||||
'优先选择非自动生成(ai)字幕',
|
||||
'跳过自动生成(ai)字幕,选择第一个可用字幕',
|
||||
'静音时等同第二项,非静音时等同第三项'
|
||||
][index];
|
||||
'默认不显示字幕',
|
||||
'优先选择非自动生成(ai)字幕',
|
||||
'跳过自动生成(ai)字幕,选择第一个可用字幕',
|
||||
'静音时等同第二项,非静音时等同第三项',
|
||||
][index];
|
||||
|
||||
static const List<String> _codeList = ['off', 'on', 'withoutAi', 'auto'];
|
||||
String get code => _codeList[index];
|
||||
|
||||
Reference in New Issue
Block a user