mod: 侧边栏、动态重构,排行改为首页分区,平板、折叠屏、竖屏视频新适配,播放页可隐藏黑边、截图、点踩,弹幕粗细调整,默认关闭后台播放,弹窗接受返回

This commit is contained in:
orz12
2024-05-20 14:46:31 +08:00
parent fd51cddeca
commit 074bf03946
97 changed files with 4105 additions and 2672 deletions

View File

@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
final List<Map<String, dynamic>> colorThemeTypes = [
{'color': const Color.fromARGB(255, 92, 182, 123), 'label': '默认绿'},
{'color': Colors.pink, 'label': '粉红色'},
{'color': const Color.fromARGB(255, 251, 114, 153), 'label': '粉红色'},
{'color': Colors.red, 'label': '红色'},
{'color': Colors.orange, 'label': '橙色'},
{'color': Colors.amber, 'label': '琥珀色'},

View File

@@ -1,11 +1,56 @@
import 'package:get/get.dart';
import '../../pages/dynamics/tab/controller.dart';
import '../../pages/dynamics/tab/view.dart';
enum DynamicsType {
all,
video,
pgc,
article,
up,
}
extension BusinessTypeExtension on DynamicsType {
String get values => ['all', 'video', 'pgc', 'article'][index];
String get labels => ['全部', '投稿', '番剧', '专栏'][index];
String get values => ['all', 'video', 'pgc', 'article', 'up'][index];
String get labels => ['全部', '投稿', '番剧', '专栏', 'Up'][index];
}
List tabsConfig = [
{
'value': DynamicsType.all,
'label': '全部',
'enabled': true,
'ctr': Get.put<DynamicsTabController>(DynamicsTabController(), tag: 'all'),
'page': const DynamicsTabPage(dynamicsType: 'all'),
},
{
'value': DynamicsType.video,
'label': '投稿',
'enabled': true,
'ctr':
Get.put<DynamicsTabController>(DynamicsTabController(), tag: 'video'),
'page': const DynamicsTabPage(dynamicsType: 'video'),
},
{
'value': DynamicsType.pgc,
'label': '番剧',
'enabled': true,
'ctr': Get.put<DynamicsTabController>(DynamicsTabController(), tag: 'pgc'),
'page': const DynamicsTabPage(dynamicsType: 'pgc'),
},
{
'value': DynamicsType.article,
'label': '专栏',
'enabled': true,
'ctr':
Get.put<DynamicsTabController>(DynamicsTabController(), tag: 'article'),
'page': const DynamicsTabPage(dynamicsType: 'article'),
},
{
'value': DynamicsType.up,
'label': 'Up',
'enabled': true,
'ctr': Get.put<DynamicsTabController>(DynamicsTabController(), tag: 'up'),
'page': const DynamicsTabPage(dynamicsType: 'up'),
},
];

View File

@@ -5,30 +5,17 @@ List defaultNavigationBars = [
'id': 0,
'icon': const Icon(
Icons.home_outlined,
size: 21,
size: 23,
),
'selectIcon': const Icon(
Icons.home,
size: 21,
size: 23,
),
'label': "首页",
'count': 0,
},
{
'id': 1,
'icon': const Icon(
Icons.leaderboard_outlined,
size: 21,
),
'selectIcon': const Icon(
Icons.leaderboard,
size: 21,
),
'label': "排行榜",
'count': 0,
},
{
'id': 2,
'icon': const Icon(
Icons.motion_photos_on_outlined,
size: 21,
@@ -41,7 +28,7 @@ List defaultNavigationBars = [
'count': 0,
},
{
'id': 3,
'id': 2,
'icon': const Icon(
Icons.video_collection_outlined,
size: 20,

View File

@@ -74,7 +74,7 @@ List tabsConfig = [
),
'label': '全站',
'type': RandType.all,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '0'),
'page': const ZonePage(rid: 0),
},
{
@@ -84,7 +84,7 @@ List tabsConfig = [
),
'label': '国创',
'type': RandType.creation,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '168'),
'page': const ZonePage(rid: 168),
},
{
@@ -94,7 +94,7 @@ List tabsConfig = [
),
'label': '动画',
'type': RandType.animation,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '1'),
'page': const ZonePage(rid: 1),
},
{
@@ -104,7 +104,7 @@ List tabsConfig = [
),
'label': '音乐',
'type': RandType.music,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '3'),
'page': const ZonePage(rid: 3),
},
{
@@ -114,7 +114,7 @@ List tabsConfig = [
),
'label': '舞蹈',
'type': RandType.dance,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '129'),
'page': const ZonePage(rid: 129),
},
{
@@ -124,7 +124,7 @@ List tabsConfig = [
),
'label': '游戏',
'type': RandType.game,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '4'),
'page': const ZonePage(rid: 4),
},
{
@@ -134,7 +134,7 @@ List tabsConfig = [
),
'label': '知识',
'type': RandType.knowledge,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '36'),
'page': const ZonePage(rid: 36),
},
{
@@ -144,7 +144,7 @@ List tabsConfig = [
),
'label': '科技',
'type': RandType.technology,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '188'),
'page': const ZonePage(rid: 188),
},
{
@@ -154,7 +154,7 @@ List tabsConfig = [
),
'label': '运动',
'type': RandType.sport,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '234'),
'page': const ZonePage(rid: 234),
},
{
@@ -164,7 +164,7 @@ List tabsConfig = [
),
'label': '汽车',
'type': RandType.car,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '223'),
'page': const ZonePage(rid: 223),
},
{
@@ -174,7 +174,7 @@ List tabsConfig = [
),
'label': '生活',
'type': RandType.life,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '160'),
'page': const ZonePage(rid: 160),
},
{
@@ -184,7 +184,7 @@ List tabsConfig = [
),
'label': '美食',
'type': RandType.food,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '211'),
'page': const ZonePage(rid: 211),
},
{
@@ -194,7 +194,7 @@ List tabsConfig = [
),
'label': '动物',
'type': RandType.animal,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '217'),
'page': const ZonePage(rid: 217),
},
{
@@ -204,7 +204,7 @@ List tabsConfig = [
),
'label': '鬼畜',
'type': RandType.madness,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '119'),
'page': const ZonePage(rid: 119),
},
{
@@ -214,7 +214,7 @@ List tabsConfig = [
),
'label': '时尚',
'type': RandType.fashion,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '155'),
'page': const ZonePage(rid: 155),
},
{
@@ -224,7 +224,7 @@ List tabsConfig = [
),
'label': '娱乐',
'type': RandType.entertainment,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '5'),
'page': const ZonePage(rid: 5),
},
{
@@ -234,7 +234,7 @@ List tabsConfig = [
),
'label': '影视',
'type': RandType.film,
'ctr': Get.put<ZoneController>,
'ctr': Get.put<ZoneController>(ZoneController(), tag: '181'),
'page': const ZonePage(rid: 181),
}
];

View File

@@ -1,3 +1,4 @@
import 'package:PiliPalaX/pages/rank/index.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:PiliPalaX/pages/bangumi/index.dart';
@@ -5,11 +6,11 @@ import 'package:PiliPalaX/pages/hot/index.dart';
import 'package:PiliPalaX/pages/live/index.dart';
import 'package:PiliPalaX/pages/rcmd/index.dart';
enum TabType { live, rcmd, hot, bangumi }
enum TabType { live, rcmd, hot, rank, bangumi }
extension TabTypeDesc on TabType {
String get description => ['直播', '推荐', '热门', '番剧'][index];
String get id => ['live', 'rcmd', 'hot', 'bangumi'][index];
String get description => ['直播', '推荐', '热门', '分区', '番剧'][index];
String get id => ['live', 'rcmd', 'hot', 'rank', 'bangumi'][index];
}
List tabsConfig = [
@@ -43,6 +44,16 @@ List tabsConfig = [
'ctr': Get.find<HotController>,
'page': const HotPage(),
},
{
'icon': const Icon(
Icons.category_outlined,
size: 15,
),
'label': '分区',
'type': TabType.rank,
'ctr': Get.find<RankController>,
'page': const RankPage(),
},
{
'icon': const Icon(
Icons.play_circle_outlined,

View File

@@ -0,0 +1,15 @@
enum UpPanelPosition {
leftFixed,
rightFixed,
leftDrawer,
rightDrawer,
}
extension UpPanelPositionDesc on UpPanelPosition {
String get values => ['left_fixed', 'right_fixed', 'left_drawer', 'right_drawer'][index];
String get labels => ['左侧常驻','右侧常驻','左侧抽屉','右侧抽屉'][index];
}
extension UpPanelPositionCode on UpPanelPosition {
int get code => [0, 1, 2, 3][index];
}

View File

@@ -0,0 +1,94 @@
class DanmakuBlockDataModel {
List<Rule>? rule;
String? toast;
int? valid;
int? ver;
DanmakuBlockDataModel({this.rule, this.toast, this.valid, this.ver});
DanmakuBlockDataModel.fromJson(Map<String, dynamic> json) {
if (json['rule'] != null) {
rule = <Rule>[];
json['rule'].forEach((v) {
rule!.add(Rule.fromJson(v));
});
}
toast = json['toast'];
valid = json['valid'];
ver = json['ver'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (rule != null) {
data['rule'] = rule!.map((v) => v.toJson()).toList();
}
data['toast'] = toast;
data['valid'] = valid;
data['ver'] = ver;
return data;
}
}
class Rule {
int? id;
int? mid;
int? type;
String? filter;
String? comment;
int? ctime;
int? mtime;
Rule(
{this.id,
this.mid,
this.type,
this.filter,
this.comment,
this.ctime,
this.mtime});
Rule.fromJson(Map<String, dynamic> json) {
id = json['id'];
mid = json['mid'];
type = json['type'];
filter = json['filter'];
comment = json['comment'];
ctime = json['ctime'];
mtime = json['mtime'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['mid'] = mid;
data['type'] = type;
data['filter'] = filter;
data['comment'] = comment;
data['ctime'] = ctime;
data['mtime'] = mtime;
return data;
}
}
class SimpleRule {
final int id;
final int type;
final String filter;
SimpleRule(this.id, this.type, this.filter);
Map<String, dynamic> toMap() {
return {
'id': id,
'type': type,
'filter': filter,
};
}
factory SimpleRule.fromMap(Map<String, dynamic> map) {
return SimpleRule(
map['id'],
map['type'],
map['filter'],
);
}
}