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

@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:hive/hive.dart';
@@ -231,9 +232,29 @@ class BangumiIntroController extends GetxController {
// 分享视频
Future actionShareVideo() async {
var result = await Share.share('${HttpString.baseUrl}/video/$bvid')
.whenComplete(() {});
return result;
showDialog(
context: Get.context!,
builder: (context) {
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
return AlertDialog(
title: const Text('分享方式'),
actions: [
TextButton(
onPressed: () {
Clipboard.setData(ClipboardData(text: videoUrl));
SmartDialog.showToast('已复制');
},
child: const Text('复制链接到剪贴板')),
TextButton(
onPressed: () async {
var result =
await Share.share(videoUrl).whenComplete(() {});
return result;
},
child: const Text('分享视频')),
],
);
});
}
// 选择文件夹

View File

@@ -1,3 +1,4 @@
import 'package:PiliPalaX/plugin/pl_player/index.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@@ -283,56 +284,35 @@ class _BangumiInfoState extends State<BangumiInfo> {
: bangumiItem!.stat!['danmakus'],
size: 'medium',
),
if (isLandscape) ...[
const SizedBox(width: 6),
AreasAndPubTime(
widget: widget,
bangumiItem: bangumiItem,
t: t),
const SizedBox(width: 6),
NewEpDesc(
widget: widget,
bangumiItem: bangumiItem,
t: t),
]
],
),
SizedBox(height: isLandscape ? 2 : 6),
Row(
children: [
Text(
!widget.loadingStatus
? (widget.bangumiDetail!.areas!
.isNotEmpty
? widget.bangumiDetail!.areas!
.first['name']
: '')
: (bangumiItem!.areas!.isNotEmpty
? bangumiItem!
.areas!.first['name']
: ''),
style: TextStyle(
fontSize: 12,
color: t.colorScheme.outline,
),
),
const SizedBox(width: 6),
Text(
!widget.loadingStatus
? widget.bangumiDetail!
.publish!['pub_time_show']
: bangumiItem!
.publish!['pub_time_show'],
style: TextStyle(
fontSize: 12,
color: t.colorScheme.outline,
),
),
],
),
// const SizedBox(height: 4),
Text(
!widget.loadingStatus
? widget.bangumiDetail!.newEp!['desc']
: bangumiItem!.newEp!['desc'],
style: TextStyle(
fontSize: 12,
color: t.colorScheme.outline,
),
),
// const SizedBox(height: 10),
if (!isLandscape)
AreasAndPubTime(
widget: widget,
bangumiItem: bangumiItem,
t: t),
if (!isLandscape)
NewEpDesc(
widget: widget,
bangumiItem: bangumiItem,
t: t),
const Spacer(),
Text(
'简介:${!widget.loadingStatus ? widget.bangumiDetail!.evaluate! : bangumiItem!.evaluate!}',
maxLines: isLandscape ? 1 : 3,
maxLines: isLandscape ? 2 : 3,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: 13,
@@ -525,3 +505,73 @@ class _BangumiInfoState extends State<BangumiInfo> {
]);
}
}
class AreasAndPubTime extends StatelessWidget {
const AreasAndPubTime({
super.key,
required this.widget,
required this.bangumiItem,
required this.t,
});
final BangumiInfo widget;
final BangumiInfoModel? bangumiItem;
final ThemeData t;
@override
Widget build(BuildContext context) {
return Row(
children: [
Text(
!widget.loadingStatus
? (widget.bangumiDetail!.areas!.isNotEmpty
? widget.bangumiDetail!.areas!.first['name']
: '')
: (bangumiItem!.areas!.isNotEmpty
? bangumiItem!.areas!.first['name']
: ''),
style: TextStyle(
fontSize: 12,
color: t.colorScheme.outline,
),
),
const SizedBox(width: 6),
Text(
!widget.loadingStatus
? widget.bangumiDetail!.publish!['pub_time_show']
: bangumiItem!.publish!['pub_time_show'],
style: TextStyle(
fontSize: 12,
color: t.colorScheme.outline,
),
),
],
);
}
}
class NewEpDesc extends StatelessWidget {
const NewEpDesc({
super.key,
required this.widget,
required this.bangumiItem,
required this.t,
});
final BangumiInfo widget;
final BangumiInfoModel? bangumiItem;
final ThemeData t;
@override
Widget build(BuildContext context) {
return Text(
!widget.loadingStatus
? widget.bangumiDetail!.newEp!['desc']
: bangumiItem!.newEp!['desc'],
style: TextStyle(
fontSize: 12,
color: t.colorScheme.outline,
),
);
}
}