Compare commits
23 Commits
alpha
...
fix-replyP
| Author | SHA1 | Date | |
|---|---|---|---|
| f81f348a3e | |||
| 4191cafe78 | |||
| ae33cbf7ca | |||
| fca7c36203 | |||
| 5fc783ebc2 | |||
| 98122aeaae | |||
| f0d8e2a122 | |||
| f815affff9 | |||
| fce701090a | |||
| d6da2a8a47 | |||
| b3e162c8d3 | |||
| e5eae93a78 | |||
| 962dcca6d4 | |||
| be56fb721f | |||
| ce1c80fd86 | |||
| 33ef18ef1d | |||
| ba61e38c9b | |||
| 0b0db1a2b1 | |||
| a9d73a9f1b | |||
| 0b5397ec00 | |||
| 466214b26a | |||
| db03cdd442 | |||
| 542975d0ec |
@ -231,6 +231,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
const SizedBox(height: 2),
|
const SizedBox(height: 2),
|
||||||
VideoStat(
|
VideoStat(
|
||||||
videoItem: videoItem,
|
videoItem: videoItem,
|
||||||
|
crossAxisCount: crossAxisCount,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
if (crossAxisCount == 1) const SizedBox(height: 4),
|
if (crossAxisCount == 1) const SizedBox(height: 4),
|
||||||
@ -294,6 +295,7 @@ class VideoContent extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
VideoStat(
|
VideoStat(
|
||||||
videoItem: videoItem,
|
videoItem: videoItem,
|
||||||
|
crossAxisCount: crossAxisCount,
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
],
|
],
|
||||||
@ -317,10 +319,12 @@ class VideoContent extends StatelessWidget {
|
|||||||
|
|
||||||
class VideoStat extends StatelessWidget {
|
class VideoStat extends StatelessWidget {
|
||||||
final dynamic videoItem;
|
final dynamic videoItem;
|
||||||
|
final int crossAxisCount;
|
||||||
|
|
||||||
const VideoStat({
|
const VideoStat({
|
||||||
Key? key,
|
Key? key,
|
||||||
required this.videoItem,
|
required this.videoItem,
|
||||||
|
required this.crossAxisCount,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -337,7 +341,7 @@ class VideoStat extends StatelessWidget {
|
|||||||
danmu: videoItem.stat.danmu,
|
danmu: videoItem.stat.danmu,
|
||||||
),
|
),
|
||||||
if (videoItem is RecVideoItemModel) ...<Widget>[
|
if (videoItem is RecVideoItemModel) ...<Widget>[
|
||||||
const Spacer(),
|
crossAxisCount > 1 ? const Spacer() : const SizedBox(width: 8),
|
||||||
RichText(
|
RichText(
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
text: TextSpan(
|
text: TextSpan(
|
||||||
|
|||||||
12
lib/models/common/gesture_mode.dart
Normal file
12
lib/models/common/gesture_mode.dart
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
enum FullScreenGestureMode {
|
||||||
|
/// 从上滑到下
|
||||||
|
fromToptoBottom,
|
||||||
|
|
||||||
|
/// 从下滑到上
|
||||||
|
fromBottomtoTop,
|
||||||
|
}
|
||||||
|
|
||||||
|
extension FullScreenGestureModeExtension on FullScreenGestureMode {
|
||||||
|
String get values => ['fromToptoBottom', 'fromBottomtoTop'][index];
|
||||||
|
String get labels => ['从上往下滑进入全屏', '从下往上滑进入全屏'][index];
|
||||||
|
}
|
||||||
4
lib/models/common/index.dart
Normal file
4
lib/models/common/index.dart
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
library commonn_model;
|
||||||
|
|
||||||
|
export './business_type.dart';
|
||||||
|
export './gesture_mode.dart';
|
||||||
@ -2,15 +2,22 @@ class FollowUpModel {
|
|||||||
FollowUpModel({
|
FollowUpModel({
|
||||||
this.liveUsers,
|
this.liveUsers,
|
||||||
this.upList,
|
this.upList,
|
||||||
|
this.liveList,
|
||||||
});
|
});
|
||||||
|
|
||||||
LiveUsers? liveUsers;
|
LiveUsers? liveUsers;
|
||||||
List<UpItem>? upList;
|
List<UpItem>? upList;
|
||||||
|
List<LiveUserItem>? liveList;
|
||||||
|
|
||||||
FollowUpModel.fromJson(Map<String, dynamic> json) {
|
FollowUpModel.fromJson(Map<String, dynamic> json) {
|
||||||
liveUsers = json['live_users'] != null
|
liveUsers = json['live_users'] != null
|
||||||
? LiveUsers.fromJson(json['live_users'])
|
? LiveUsers.fromJson(json['live_users'])
|
||||||
: null;
|
: null;
|
||||||
|
liveList = json['live_users'] != null
|
||||||
|
? json['live_users']['items']
|
||||||
|
.map<LiveUserItem>((e) => LiveUserItem.fromJson(e))
|
||||||
|
.toList()
|
||||||
|
: [];
|
||||||
upList = json['up_list'] != null
|
upList = json['up_list'] != null
|
||||||
? json['up_list'].map<UpItem>((e) => UpItem.fromJson(e)).toList()
|
? json['up_list'].map<UpItem>((e) => UpItem.fromJson(e)).toList()
|
||||||
: [];
|
: [];
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class FavFolderData {
|
|||||||
? json['list']
|
? json['list']
|
||||||
.map<FavFolderItemData>((e) => FavFolderItemData.fromJson(e))
|
.map<FavFolderItemData>((e) => FavFolderItemData.fromJson(e))
|
||||||
.toList()
|
.toList()
|
||||||
: [FavFolderItemData()];
|
: <FavFolderItemData>[];
|
||||||
hasMore = json['has_more'];
|
hasMore = json['has_more'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,8 +7,8 @@ import 'package:pilipala/utils/storage.dart';
|
|||||||
|
|
||||||
class BangumiController extends GetxController {
|
class BangumiController extends GetxController {
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
RxList<BangumiListItemModel> bangumiList = [BangumiListItemModel()].obs;
|
RxList<BangumiListItemModel> bangumiList = <BangumiListItemModel>[].obs;
|
||||||
RxList<BangumiListItemModel> bangumiFollowList = [BangumiListItemModel()].obs;
|
RxList<BangumiListItemModel> bangumiFollowList = <BangumiListItemModel>[].obs;
|
||||||
int _currentPage = 1;
|
int _currentPage = 1;
|
||||||
bool isLoadingMore = true;
|
bool isLoadingMore = true;
|
||||||
Box userInfoCache = GStrorage.userInfo;
|
Box userInfoCache = GStrorage.userInfo;
|
||||||
|
|||||||
@ -139,7 +139,7 @@ class BlackListController extends GetxController {
|
|||||||
int currentPage = 1;
|
int currentPage = 1;
|
||||||
int pageSize = 50;
|
int pageSize = 50;
|
||||||
RxInt total = 0.obs;
|
RxInt total = 0.obs;
|
||||||
RxList<BlackListItem> blackList = [BlackListItem()].obs;
|
RxList<BlackListItem> blackList = <BlackListItem>[].obs;
|
||||||
|
|
||||||
Future queryBlacklist({type = 'init'}) async {
|
Future queryBlacklist({type = 'init'}) async {
|
||||||
if (type == 'init') {
|
if (type == 'init') {
|
||||||
|
|||||||
@ -20,7 +20,7 @@ import 'package:pilipala/utils/utils.dart';
|
|||||||
class DynamicsController extends GetxController {
|
class DynamicsController extends GetxController {
|
||||||
int page = 1;
|
int page = 1;
|
||||||
String? offset = '';
|
String? offset = '';
|
||||||
RxList<DynamicItemModel> dynamicsList = [DynamicItemModel()].obs;
|
RxList<DynamicItemModel> dynamicsList = <DynamicItemModel>[].obs;
|
||||||
Rx<DynamicsType> dynamicsType = DynamicsType.values[0].obs;
|
Rx<DynamicsType> dynamicsType = DynamicsType.values[0].obs;
|
||||||
RxString dynamicsTypeLabel = '全部'.obs;
|
RxString dynamicsTypeLabel = '全部'.obs;
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
@ -105,7 +105,7 @@ class DynamicsController extends GetxController {
|
|||||||
|
|
||||||
onSelectType(value) async {
|
onSelectType(value) async {
|
||||||
dynamicsType.value = filterTypeList[value]['value'];
|
dynamicsType.value = filterTypeList[value]['value'];
|
||||||
dynamicsList.value = [DynamicItemModel()];
|
dynamicsList.value = <DynamicItemModel>[];
|
||||||
page = 1;
|
page = 1;
|
||||||
initialValue.value = value;
|
initialValue.value = value;
|
||||||
await queryFollowDynamic();
|
await queryFollowDynamic();
|
||||||
@ -249,8 +249,8 @@ class DynamicsController extends GetxController {
|
|||||||
return {'status': false, 'msg': '账号未登录'};
|
return {'status': false, 'msg': '账号未登录'};
|
||||||
}
|
}
|
||||||
if (type == 'init') {
|
if (type == 'init') {
|
||||||
upData.value.upList = [];
|
upData.value.upList = <UpItem>[];
|
||||||
upData.value.liveUsers = LiveUsers();
|
upData.value.liveList = <LiveUserItem>[];
|
||||||
}
|
}
|
||||||
var res = await DynamicsHttp.followUp();
|
var res = await DynamicsHttp.followUp();
|
||||||
if (res['status']) {
|
if (res['status']) {
|
||||||
@ -264,14 +264,13 @@ class DynamicsController extends GetxController {
|
|||||||
|
|
||||||
onSelectUp(mid) async {
|
onSelectUp(mid) async {
|
||||||
dynamicsType.value = DynamicsType.values[0];
|
dynamicsType.value = DynamicsType.values[0];
|
||||||
dynamicsList.value = [DynamicItemModel()];
|
dynamicsList.value = <DynamicItemModel>[];
|
||||||
page = 1;
|
page = 1;
|
||||||
queryFollowDynamic();
|
queryFollowDynamic();
|
||||||
}
|
}
|
||||||
|
|
||||||
onRefresh() async {
|
onRefresh() async {
|
||||||
page = 1;
|
page = 1;
|
||||||
print('onRefresh');
|
|
||||||
await queryFollowUp();
|
await queryFollowUp();
|
||||||
await queryFollowDynamic();
|
await queryFollowDynamic();
|
||||||
}
|
}
|
||||||
@ -293,7 +292,7 @@ class DynamicsController extends GetxController {
|
|||||||
dynamicsType.value = DynamicsType.values[0];
|
dynamicsType.value = DynamicsType.values[0];
|
||||||
initialValue.value = 0;
|
initialValue.value = 0;
|
||||||
SmartDialog.showToast('还原默认加载');
|
SmartDialog.showToast('还原默认加载');
|
||||||
dynamicsList.value = [DynamicItemModel()];
|
dynamicsList.value = <DynamicItemModel>[];
|
||||||
queryFollowDynamic();
|
queryFollowDynamic();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class DynamicDetailController extends GetxController {
|
|||||||
int currentPage = 0;
|
int currentPage = 0;
|
||||||
bool isLoadingMore = false;
|
bool isLoadingMore = false;
|
||||||
RxString noMore = ''.obs;
|
RxString noMore = ''.obs;
|
||||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||||
RxInt acount = 0.obs;
|
RxInt acount = 0.obs;
|
||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,9 @@ class _ContentState extends State<Content> {
|
|||||||
if (len == 1) {
|
if (len == 1) {
|
||||||
OpusPicsModel pictureItem = pics.first;
|
OpusPicsModel pictureItem = pics.first;
|
||||||
picList.add(pictureItem.url!);
|
picList.add(pictureItem.url!);
|
||||||
spanChilds.add(const TextSpan(text: '\n'));
|
|
||||||
|
/// 图片上方的空白间隔
|
||||||
|
// spanChilds.add(const TextSpan(text: '\n'));
|
||||||
spanChilds.add(
|
spanChilds.add(
|
||||||
WidgetSpan(
|
WidgetSpan(
|
||||||
child: LayoutBuilder(
|
child: LayoutBuilder(
|
||||||
|
|||||||
@ -19,6 +19,17 @@ InlineSpan richNode(item, context) {
|
|||||||
// 动态页面 richTextNodes 层级可能与主页动态层级不同
|
// 动态页面 richTextNodes 层级可能与主页动态层级不同
|
||||||
richTextNodes =
|
richTextNodes =
|
||||||
item.modules.moduleDynamic.major.opus.summary.richTextNodes;
|
item.modules.moduleDynamic.major.opus.summary.richTextNodes;
|
||||||
|
if (item.modules.moduleDynamic.major.opus.title != null) {
|
||||||
|
spanChilds.add(
|
||||||
|
TextSpan(
|
||||||
|
text: item.modules.moduleDynamic.major.opus.title + '\n',
|
||||||
|
style: Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.titleMedium!
|
||||||
|
.copyWith(fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (richTextNodes == null || richTextNodes.isEmpty) {
|
if (richTextNodes == null || richTextNodes.isEmpty) {
|
||||||
return spacer;
|
return spacer;
|
||||||
|
|||||||
@ -31,8 +31,8 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
upList = widget.upData!.upList!;
|
upList = widget.upData!.upList!;
|
||||||
if (widget.upData!.liveUsers != null) {
|
if (widget.upData!.liveList!.isNotEmpty) {
|
||||||
liveList = widget.upData!.liveUsers!.items!;
|
liveList = widget.upData!.liveList!;
|
||||||
}
|
}
|
||||||
upList.insert(
|
upList.insert(
|
||||||
0,
|
0,
|
||||||
@ -55,7 +55,7 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
floating: true,
|
floating: true,
|
||||||
pinned: false,
|
pinned: false,
|
||||||
delegate: _SliverHeaderDelegate(
|
delegate: _SliverHeaderDelegate(
|
||||||
height: 126,
|
height: liveList.isNotEmpty || upList.isNotEmpty ? 126 : 0,
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
@ -90,7 +90,7 @@ class _UpPanelState extends State<UpPanel> {
|
|||||||
color: Theme.of(context).colorScheme.background,
|
color: Theme.of(context).colorScheme.background,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Flexible(
|
||||||
child: ListView(
|
child: ListView(
|
||||||
scrollDirection: Axis.horizontal,
|
scrollDirection: Axis.horizontal,
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
|
|||||||
@ -10,7 +10,7 @@ class FansController extends GetxController {
|
|||||||
int pn = 1;
|
int pn = 1;
|
||||||
int ps = 20;
|
int ps = 20;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
RxList<FansItemModel> fansList = [FansItemModel()].obs;
|
RxList<FansItemModel> fansList = <FansItemModel>[].obs;
|
||||||
late int mid;
|
late int mid;
|
||||||
late String name;
|
late String name;
|
||||||
var userInfo;
|
var userInfo;
|
||||||
|
|||||||
@ -58,6 +58,9 @@ class _HomePageState extends State<HomePage>
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
extendBody: true,
|
extendBody: true,
|
||||||
extendBodyBehindAppBar: true,
|
extendBodyBehindAppBar: true,
|
||||||
|
appBar: _homeController.enableGradientBg
|
||||||
|
? null
|
||||||
|
: AppBar(toolbarHeight: 0, elevation: 0),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
// gradient background
|
// gradient background
|
||||||
@ -412,13 +415,16 @@ class SearchBar extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
Obx(
|
Obx(
|
||||||
() => Text(
|
() => Expanded(
|
||||||
ctr!.defaultSearch.value,
|
child: Text(
|
||||||
maxLines: 1,
|
ctr!.defaultSearch.value,
|
||||||
overflow: TextOverflow.ellipsis,
|
maxLines: 1,
|
||||||
style: TextStyle(color: colorScheme.outline),
|
overflow: TextOverflow.ellipsis,
|
||||||
|
style: TextStyle(color: colorScheme.outline),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(width: 15),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -7,7 +7,7 @@ class HotController extends GetxController {
|
|||||||
final ScrollController scrollController = ScrollController();
|
final ScrollController scrollController = ScrollController();
|
||||||
final int _count = 20;
|
final int _count = 20;
|
||||||
int _currentPage = 1;
|
int _currentPage = 1;
|
||||||
RxList<HotVideoItemModel> videoList = [HotVideoItemModel()].obs;
|
RxList<HotVideoItemModel> videoList = <HotVideoItemModel>[].obs;
|
||||||
bool isLoadingMore = false;
|
bool isLoadingMore = false;
|
||||||
bool flag = false;
|
bool flag = false;
|
||||||
OverlayEntry? popupDialog;
|
OverlayEntry? popupDialog;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class MemberController extends GetxController {
|
|||||||
Box userInfoCache = GStrorage.userInfo;
|
Box userInfoCache = GStrorage.userInfo;
|
||||||
late int ownerMid;
|
late int ownerMid;
|
||||||
// 投稿列表
|
// 投稿列表
|
||||||
RxList<VListItemModel>? archiveList = [VListItemModel()].obs;
|
RxList<VListItemModel>? archiveList = <VListItemModel>[].obs;
|
||||||
dynamic userInfo;
|
dynamic userInfo;
|
||||||
RxInt attribute = (-1).obs;
|
RxInt attribute = (-1).obs;
|
||||||
RxString attributeText = '关注'.obs;
|
RxString attributeText = '关注'.obs;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class SSearchController extends GetxController {
|
|||||||
Box histiryWord = GStrorage.historyword;
|
Box histiryWord = GStrorage.historyword;
|
||||||
List historyCacheList = [];
|
List historyCacheList = [];
|
||||||
RxList historyList = [].obs;
|
RxList historyList = [].obs;
|
||||||
RxList<SearchSuggestItem> searchSuggestList = [SearchSuggestItem()].obs;
|
RxList<SearchSuggestItem> searchSuggestList = <SearchSuggestItem>[].obs;
|
||||||
final _debouncer =
|
final _debouncer =
|
||||||
Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间
|
Debouncer(delay: const Duration(milliseconds: 200)); // 设置延迟时间
|
||||||
String hintText = '搜索';
|
String hintText = '搜索';
|
||||||
|
|||||||
88
lib/pages/setting/pages/play_gesture_set.dart
Normal file
88
lib/pages/setting/pages/play_gesture_set.dart
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
import 'package:pilipala/utils/global_data.dart';
|
||||||
|
|
||||||
|
import '../../../models/common/gesture_mode.dart';
|
||||||
|
import '../../../utils/storage.dart';
|
||||||
|
import '../widgets/select_dialog.dart';
|
||||||
|
import '../widgets/switch_item.dart';
|
||||||
|
|
||||||
|
class PlayGesturePage extends StatefulWidget {
|
||||||
|
const PlayGesturePage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<PlayGesturePage> createState() => _PlayGesturePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PlayGesturePageState extends State<PlayGesturePage> {
|
||||||
|
Box setting = GStrorage.setting;
|
||||||
|
late int fullScreenGestureMode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
fullScreenGestureMode = setting.get(SettingBoxKey.fullScreenGestureMode,
|
||||||
|
defaultValue: FullScreenGestureMode.values.last.index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
TextStyle titleStyle = Theme.of(context).textTheme.titleMedium!;
|
||||||
|
TextStyle subTitleStyle = Theme.of(context)
|
||||||
|
.textTheme
|
||||||
|
.labelMedium!
|
||||||
|
.copyWith(color: Theme.of(context).colorScheme.outline);
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
centerTitle: false,
|
||||||
|
titleSpacing: 0,
|
||||||
|
title: Text(
|
||||||
|
'手势设置',
|
||||||
|
style: Theme.of(context).textTheme.titleMedium,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: ListView(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
title: Text('全屏手势', style: titleStyle),
|
||||||
|
subtitle: Text(
|
||||||
|
'通过手势快速进入全屏',
|
||||||
|
style: subTitleStyle,
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
String? result = await showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (context) {
|
||||||
|
return SelectDialog<String>(
|
||||||
|
title: '全屏手势',
|
||||||
|
value: FullScreenGestureMode
|
||||||
|
.values[fullScreenGestureMode].values,
|
||||||
|
values: FullScreenGestureMode.values.map((e) {
|
||||||
|
return {'title': e.labels, 'value': e.values};
|
||||||
|
}).toList());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (result != null) {
|
||||||
|
GlobalData().fullScreenGestureMode = FullScreenGestureMode
|
||||||
|
.values
|
||||||
|
.firstWhere((element) => element.values == result);
|
||||||
|
fullScreenGestureMode =
|
||||||
|
GlobalData().fullScreenGestureMode.index;
|
||||||
|
setting.put(
|
||||||
|
SettingBoxKey.fullScreenGestureMode, fullScreenGestureMode);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SetSwitchItem(
|
||||||
|
title: '双击快退/快进',
|
||||||
|
subTitle: '左侧双击快退,右侧双击快进',
|
||||||
|
setKey: SettingBoxKey.enableQuickDouble,
|
||||||
|
defaultVal: true,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -7,6 +7,7 @@ import 'package:pilipala/models/video/play/quality.dart';
|
|||||||
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
import 'package:pilipala/pages/setting/widgets/select_dialog.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/index.dart';
|
import 'package:pilipala/plugin/pl_player/index.dart';
|
||||||
import 'package:pilipala/services/service_locator.dart';
|
import 'package:pilipala/services/service_locator.dart';
|
||||||
|
import 'package:pilipala/utils/global_data.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
import 'widgets/switch_item.dart';
|
import 'widgets/switch_item.dart';
|
||||||
@ -73,6 +74,12 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
title: Text('倍速设置', style: titleStyle),
|
title: Text('倍速设置', style: titleStyle),
|
||||||
subtitle: Text('设置视频播放速度', style: subTitleStyle),
|
subtitle: Text('设置视频播放速度', style: subTitleStyle),
|
||||||
),
|
),
|
||||||
|
ListTile(
|
||||||
|
dense: false,
|
||||||
|
onTap: () => Get.toNamed('/playerGestureSet'),
|
||||||
|
title: Text('手势设置', style: titleStyle),
|
||||||
|
subtitle: Text('设置播放器手势', style: subTitleStyle),
|
||||||
|
),
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '开启1080P',
|
title: '开启1080P',
|
||||||
subTitle: '免登录查看1080P视频',
|
subTitle: '免登录查看1080P视频',
|
||||||
@ -134,18 +141,20 @@ class _PlaySettingState extends State<PlaySetting> {
|
|||||||
setKey: SettingBoxKey.enableAutoBrightness,
|
setKey: SettingBoxKey.enableAutoBrightness,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
const SetSwitchItem(
|
|
||||||
title: '双击快退/快进',
|
|
||||||
subTitle: '左侧双击快退,右侧双击快进',
|
|
||||||
setKey: SettingBoxKey.enableQuickDouble,
|
|
||||||
defaultVal: true,
|
|
||||||
),
|
|
||||||
const SetSwitchItem(
|
const SetSwitchItem(
|
||||||
title: '弹幕开关',
|
title: '弹幕开关',
|
||||||
subTitle: '展示弹幕',
|
subTitle: '展示弹幕',
|
||||||
setKey: SettingBoxKey.enableShowDanmaku,
|
setKey: SettingBoxKey.enableShowDanmaku,
|
||||||
defaultVal: false,
|
defaultVal: false,
|
||||||
),
|
),
|
||||||
|
SetSwitchItem(
|
||||||
|
title: '控制栏动画',
|
||||||
|
subTitle: '播放器控制栏显示动画效果',
|
||||||
|
setKey: SettingBoxKey.enablePlayerControlAnimation,
|
||||||
|
defaultVal: true,
|
||||||
|
callFn: (bool val) {
|
||||||
|
GlobalData().enablePlayerControlAnimation = val;
|
||||||
|
}),
|
||||||
ListTile(
|
ListTile(
|
||||||
dense: false,
|
dense: false,
|
||||||
title: Text('默认画质', style: titleStyle),
|
title: Text('默认画质', style: titleStyle),
|
||||||
|
|||||||
@ -128,6 +128,7 @@ class VideoDetailController extends GetxController
|
|||||||
controller: plPlayerController,
|
controller: plPlayerController,
|
||||||
videoDetailCtr: this,
|
videoDetailCtr: this,
|
||||||
floating: floating,
|
floating: floating,
|
||||||
|
bvid: bvid,
|
||||||
);
|
);
|
||||||
// CDN优化
|
// CDN优化
|
||||||
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
enableCDN = setting.get(SettingBoxKey.enableCDN, defaultValue: true);
|
||||||
|
|||||||
@ -22,8 +22,9 @@ import '../related/index.dart';
|
|||||||
import 'widgets/group_panel.dart';
|
import 'widgets/group_panel.dart';
|
||||||
|
|
||||||
class VideoIntroController extends GetxController {
|
class VideoIntroController extends GetxController {
|
||||||
|
VideoIntroController({required this.bvid});
|
||||||
// 视频bvid
|
// 视频bvid
|
||||||
String bvid = Get.parameters['bvid']!;
|
String bvid;
|
||||||
|
|
||||||
// 是否预渲染 骨架屏
|
// 是否预渲染 骨架屏
|
||||||
bool preRender = false;
|
bool preRender = false;
|
||||||
|
|||||||
@ -24,7 +24,10 @@ import 'widgets/page.dart';
|
|||||||
import 'widgets/season.dart';
|
import 'widgets/season.dart';
|
||||||
|
|
||||||
class VideoIntroPanel extends StatefulWidget {
|
class VideoIntroPanel extends StatefulWidget {
|
||||||
const VideoIntroPanel({super.key});
|
final String bvid;
|
||||||
|
final String? cid;
|
||||||
|
|
||||||
|
const VideoIntroPanel({super.key, required this.bvid, this.cid});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VideoIntroPanel> createState() => _VideoIntroPanelState();
|
State<VideoIntroPanel> createState() => _VideoIntroPanelState();
|
||||||
@ -47,7 +50,8 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
|
|
||||||
/// fix 全屏时参数丢失
|
/// fix 全屏时参数丢失
|
||||||
heroTag = Get.arguments['heroTag'];
|
heroTag = Get.arguments['heroTag'];
|
||||||
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
videoIntroController =
|
||||||
|
Get.put(VideoIntroController(bvid: widget.bvid), tag: heroTag);
|
||||||
_futureBuilderFuture = videoIntroController.queryVideoIntro();
|
_futureBuilderFuture = videoIntroController.queryVideoIntro();
|
||||||
videoIntroController.videoDetail.listen((value) {
|
videoIntroController.videoDetail.listen((value) {
|
||||||
videoDetail = value;
|
videoDetail = value;
|
||||||
@ -77,6 +81,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
loadingStatus: false,
|
loadingStatus: false,
|
||||||
videoDetail: videoIntroController.videoDetail.value,
|
videoDetail: videoIntroController.videoDetail.value,
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
|
bvid: widget.bvid,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -95,6 +100,7 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
|||||||
loadingStatus: true,
|
loadingStatus: true,
|
||||||
videoDetail: videoDetail,
|
videoDetail: videoDetail,
|
||||||
heroTag: heroTag,
|
heroTag: heroTag,
|
||||||
|
bvid: widget.bvid,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -106,10 +112,15 @@ class VideoInfo extends StatefulWidget {
|
|||||||
final bool loadingStatus;
|
final bool loadingStatus;
|
||||||
final VideoDetailData? videoDetail;
|
final VideoDetailData? videoDetail;
|
||||||
final String? heroTag;
|
final String? heroTag;
|
||||||
|
final String bvid;
|
||||||
|
|
||||||
const VideoInfo(
|
const VideoInfo({
|
||||||
{Key? key, this.loadingStatus = false, this.videoDetail, this.heroTag})
|
Key? key,
|
||||||
: super(key: key);
|
this.loadingStatus = false,
|
||||||
|
this.videoDetail,
|
||||||
|
this.heroTag,
|
||||||
|
required this.bvid,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<VideoInfo> createState() => _VideoInfoState();
|
State<VideoInfo> createState() => _VideoInfoState();
|
||||||
@ -149,7 +160,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
|
|||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
heroTag = widget.heroTag!;
|
heroTag = widget.heroTag!;
|
||||||
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
videoIntroController =
|
||||||
|
Get.put(VideoIntroController(bvid: widget.bvid), tag: heroTag);
|
||||||
videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
videoDetailCtr = Get.find<VideoDetailController>(tag: heroTag);
|
||||||
videoItem = videoIntroController.videoItem!;
|
videoItem = videoIntroController.videoItem!;
|
||||||
sheetHeight = localCache.get('sheetHeight');
|
sheetHeight = localCache.get('sheetHeight');
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class VideoReplyController extends GetxController {
|
|||||||
String? replyLevel;
|
String? replyLevel;
|
||||||
// rpid 请求楼中楼回复
|
// rpid 请求楼中楼回复
|
||||||
String? rpid;
|
String? rpid;
|
||||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||||
// 当前页
|
// 当前页
|
||||||
int currentPage = 0;
|
int currentPage = 0;
|
||||||
bool isLoadingMore = false;
|
bool isLoadingMore = false;
|
||||||
@ -62,6 +62,7 @@ class VideoReplyController extends GetxController {
|
|||||||
noMore.value = '';
|
noMore.value = '';
|
||||||
}
|
}
|
||||||
if (noMore.value == '没有更多了') {
|
if (noMore.value == '没有更多了') {
|
||||||
|
isLoadingMore = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final res = await ReplyHttp.replyList(
|
final res = await ReplyHttp.replyList(
|
||||||
|
|||||||
@ -134,13 +134,13 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
|||||||
super.build(context);
|
super.build(context);
|
||||||
return RefreshIndicator(
|
return RefreshIndicator(
|
||||||
onRefresh: () async {
|
onRefresh: () async {
|
||||||
_videoReplyController.currentPage = 0;
|
return await _videoReplyController.queryReplyList(type: 'init');
|
||||||
return await _videoReplyController.queryReplyList();
|
|
||||||
},
|
},
|
||||||
child: Stack(
|
child: Stack(
|
||||||
children: [
|
children: [
|
||||||
CustomScrollView(
|
CustomScrollView(
|
||||||
controller: scrollController,
|
controller: scrollController,
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
key: const PageStorageKey<String>('评论'),
|
key: const PageStorageKey<String>('评论'),
|
||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
SliverPersistentHeader(
|
SliverPersistentHeader(
|
||||||
|
|||||||
@ -462,6 +462,9 @@ class ReplyItemRow extends StatelessWidget {
|
|||||||
|
|
||||||
InlineSpan buildContent(
|
InlineSpan buildContent(
|
||||||
BuildContext context, replyItem, replyReply, fReplyItem) {
|
BuildContext context, replyItem, replyReply, fReplyItem) {
|
||||||
|
final String routePath = Get.currentRoute;
|
||||||
|
bool isVideoPage = routePath.startsWith('/video');
|
||||||
|
|
||||||
// replyItem 当前回复内容
|
// replyItem 当前回复内容
|
||||||
// replyReply 查看二楼回复(回复详情)回调
|
// replyReply 查看二楼回复(回复详情)回调
|
||||||
// fReplyItem 父级回复内容,用作二楼回复(回复详情)展示
|
// fReplyItem 父级回复内容,用作二楼回复(回复详情)展示
|
||||||
@ -503,21 +506,25 @@ InlineSpan buildContent(
|
|||||||
.replaceAll('"', '"')
|
.replaceAll('"', '"')
|
||||||
.replaceAll(''', "'")
|
.replaceAll(''', "'")
|
||||||
.replaceAll(' ', ' ');
|
.replaceAll(' ', ' ');
|
||||||
// print("content.jumpUrl.keys:" + content.jumpUrl.keys.toString());
|
|
||||||
// 构建正则表达式
|
// 构建正则表达式
|
||||||
final List<String> specialTokens = [
|
final List<String> specialTokens = [
|
||||||
...content.emote.keys,
|
...content.emote.keys,
|
||||||
...content.topicsMeta?.keys?.map((e) => '#$e#') ?? [],
|
...content.topicsMeta?.keys?.map((e) => '#$e#') ?? [],
|
||||||
...content.atNameToMid.keys.map((e) => '@$e'),
|
...content.atNameToMid.keys.map((e) => '@$e'),
|
||||||
...content.jumpUrl.keys.map((e) =>
|
|
||||||
e.replaceAll('?', '\\?').replaceAll('+', '\\+').replaceAll('*', '\\*')),
|
|
||||||
];
|
];
|
||||||
|
List<dynamic> jumpUrlKeysList = content.jumpUrl.keys.map((e) {
|
||||||
|
return e.replaceAllMapped(
|
||||||
|
RegExp(r'[?+*]'), (match) => '\\${match.group(0)}');
|
||||||
|
}).toList();
|
||||||
|
|
||||||
String patternStr = specialTokens.map(RegExp.escape).join('|');
|
String patternStr = specialTokens.map(RegExp.escape).join('|');
|
||||||
if (patternStr.isNotEmpty) {
|
if (patternStr.isNotEmpty) {
|
||||||
patternStr += "|";
|
patternStr += "|";
|
||||||
}
|
}
|
||||||
patternStr += r'(\b(?:\d+[::])?[0-5]?[0-9][::][0-5]?[0-9]\b)';
|
patternStr += r'(\b(?:\d+[::])?[0-5]?[0-9][::][0-5]?[0-9]\b)';
|
||||||
|
if (jumpUrlKeysList.isNotEmpty) {
|
||||||
|
patternStr += '|${jumpUrlKeysList.join('|')}';
|
||||||
|
}
|
||||||
final RegExp pattern = RegExp(patternStr);
|
final RegExp pattern = RegExp(patternStr);
|
||||||
List<String> matchedStrs = [];
|
List<String> matchedStrs = [];
|
||||||
void addPlainTextSpan(str) {
|
void addPlainTextSpan(str) {
|
||||||
@ -571,27 +578,31 @@ InlineSpan buildContent(
|
|||||||
spanChilds.add(
|
spanChilds.add(
|
||||||
TextSpan(
|
TextSpan(
|
||||||
text: ' $matchStr ',
|
text: ' $matchStr ',
|
||||||
style: TextStyle(
|
style: isVideoPage
|
||||||
color: Theme.of(context).colorScheme.primary,
|
? TextStyle(
|
||||||
),
|
color: Theme.of(context).colorScheme.primary,
|
||||||
|
)
|
||||||
|
: null,
|
||||||
recognizer: TapGestureRecognizer()
|
recognizer: TapGestureRecognizer()
|
||||||
..onTap = () {
|
..onTap = () {
|
||||||
// 跳转到指定位置
|
// 跳转到指定位置
|
||||||
try {
|
if (isVideoPage) {
|
||||||
SmartDialog.showToast('跳转至:$matchStr');
|
try {
|
||||||
Get.find<VideoDetailController>(tag: Get.arguments['heroTag'])
|
SmartDialog.showToast('跳转至:$matchStr');
|
||||||
.plPlayerController
|
Get.find<VideoDetailController>(
|
||||||
.seekTo(
|
tag: Get.arguments['heroTag'])
|
||||||
Duration(seconds: Utils.duration(matchStr)),
|
.plPlayerController
|
||||||
);
|
.seekTo(
|
||||||
} catch (e) {
|
Duration(seconds: Utils.duration(matchStr)),
|
||||||
SmartDialog.showToast('跳转失败: $e');
|
);
|
||||||
|
} catch (e) {
|
||||||
|
SmartDialog.showToast('跳转失败: $e');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
print("matchStr=$matchStr");
|
|
||||||
String appUrlSchema = '';
|
String appUrlSchema = '';
|
||||||
final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe,
|
final bool enableWordRe = setting.get(SettingBoxKey.enableWordRe,
|
||||||
defaultValue: false) as bool;
|
defaultValue: false) as bool;
|
||||||
|
|||||||
@ -109,21 +109,26 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
@override
|
@override
|
||||||
void didChangeMetrics() {
|
void didChangeMetrics() {
|
||||||
super.didChangeMetrics();
|
super.didChangeMetrics();
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
final String routePath = Get.currentRoute;
|
||||||
// 键盘高度
|
if (mounted &&
|
||||||
final viewInsets = EdgeInsets.fromViewPadding(
|
(routePath.startsWith('/video') ||
|
||||||
View.of(context).viewInsets, View.of(context).devicePixelRatio);
|
routePath.startsWith('/dynamicDetail'))) {
|
||||||
_debouncer.run(() {
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
if (mounted) {
|
// 键盘高度
|
||||||
if (keyboardHeight == 0 && emoteHeight == 0) {
|
final viewInsets = EdgeInsets.fromViewPadding(
|
||||||
setState(() {
|
View.of(context).viewInsets, View.of(context).devicePixelRatio);
|
||||||
emoteHeight = keyboardHeight =
|
_debouncer.run(() {
|
||||||
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
if (mounted) {
|
||||||
});
|
if (keyboardHeight == 0 && emoteHeight == 0) {
|
||||||
|
setState(() {
|
||||||
|
emoteHeight = keyboardHeight =
|
||||||
|
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -131,11 +136,15 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
|
|||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
_replyContentController.dispose();
|
_replyContentController.dispose();
|
||||||
replyContentFocusNode.removeListener(() {});
|
replyContentFocusNode.removeListener(() {});
|
||||||
|
replyContentFocusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
double keyboardHeight = EdgeInsets.fromViewPadding(
|
||||||
|
View.of(context).viewInsets, View.of(context).devicePixelRatio)
|
||||||
|
.bottom;
|
||||||
return Container(
|
return Container(
|
||||||
clipBehavior: Clip.hardEdge,
|
clipBehavior: Clip.hardEdge,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
@ -12,7 +12,7 @@ class VideoReplyReplyController extends GetxController {
|
|||||||
// rpid 请求楼中楼回复
|
// rpid 请求楼中楼回复
|
||||||
String? rpid;
|
String? rpid;
|
||||||
ReplyType replyType = ReplyType.video;
|
ReplyType replyType = ReplyType.video;
|
||||||
RxList<ReplyItemModel> replyList = [ReplyItemModel()].obs;
|
RxList<ReplyItemModel> replyList = <ReplyItemModel>[].obs;
|
||||||
// 当前页
|
// 当前页
|
||||||
int currentPage = 0;
|
int currentPage = 0;
|
||||||
bool isLoadingMore = false;
|
bool isLoadingMore = false;
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import 'package:pilipala/plugin/pl_player/models/play_repeat.dart';
|
|||||||
import 'package:pilipala/services/service_locator.dart';
|
import 'package:pilipala/services/service_locator.dart';
|
||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
|
|
||||||
import 'package:pilipala/plugin/pl_player/utils/fullscreen.dart';
|
|
||||||
import '../../../services/shutdown_timer_service.dart';
|
import '../../../services/shutdown_timer_service.dart';
|
||||||
import 'widgets/header_control.dart';
|
import 'widgets/header_control.dart';
|
||||||
|
|
||||||
@ -68,7 +67,9 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
super.initState();
|
super.initState();
|
||||||
heroTag = Get.arguments['heroTag'];
|
heroTag = Get.arguments['heroTag'];
|
||||||
videoDetailController = Get.put(VideoDetailController(), tag: heroTag);
|
videoDetailController = Get.put(VideoDetailController(), tag: heroTag);
|
||||||
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
videoIntroController = Get.put(
|
||||||
|
VideoIntroController(bvid: Get.parameters['bvid']!),
|
||||||
|
tag: heroTag);
|
||||||
videoIntroController.videoDetail.listen((value) {
|
videoIntroController.videoDetail.listen((value) {
|
||||||
videoPlayerServiceHandler.onVideoDetailChange(
|
videoPlayerServiceHandler.onVideoDetailChange(
|
||||||
value, videoDetailController.cid.value);
|
value, videoDetailController.cid.value);
|
||||||
@ -227,6 +228,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
plPlayerController!.removeStatusLister(playerListener);
|
plPlayerController!.removeStatusLister(playerListener);
|
||||||
plPlayerController!.pause();
|
plPlayerController!.pause();
|
||||||
}
|
}
|
||||||
|
print('🐶🐶');
|
||||||
setState(() => isShowing = false);
|
setState(() => isShowing = false);
|
||||||
super.didPushNext();
|
super.didPushNext();
|
||||||
}
|
}
|
||||||
@ -550,7 +552,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
slivers: <Widget>[
|
slivers: <Widget>[
|
||||||
if (videoDetailController.videoType ==
|
if (videoDetailController.videoType ==
|
||||||
SearchType.video) ...[
|
SearchType.video) ...[
|
||||||
const VideoIntroPanel(),
|
VideoIntroPanel(
|
||||||
|
bvid: videoDetailController.bvid),
|
||||||
] else if (videoDetailController.videoType ==
|
] else if (videoDetailController.videoType ==
|
||||||
SearchType.media_bangumi) ...[
|
SearchType.media_bangumi) ...[
|
||||||
Obx(() => BangumiIntroPanel(
|
Obx(() => BangumiIntroPanel(
|
||||||
@ -577,7 +580,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
.withOpacity(0.06),
|
.withOpacity(0.06),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
RelatedVideoPanel(),
|
const RelatedVideoPanel(),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@ -627,6 +630,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
|
|||||||
headerControl: HeaderControl(
|
headerControl: HeaderControl(
|
||||||
controller: plPlayerController,
|
controller: plPlayerController,
|
||||||
videoDetailCtr: videoDetailController,
|
videoDetailCtr: videoDetailController,
|
||||||
|
bvid: videoDetailController.bvid,
|
||||||
),
|
),
|
||||||
danmuWidget: Obx(
|
danmuWidget: Obx(
|
||||||
() => PlDanmaku(
|
() => PlDanmaku(
|
||||||
|
|||||||
@ -27,11 +27,13 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
this.controller,
|
this.controller,
|
||||||
this.videoDetailCtr,
|
this.videoDetailCtr,
|
||||||
this.floating,
|
this.floating,
|
||||||
|
this.bvid,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final PlPlayerController? controller;
|
final PlPlayerController? controller;
|
||||||
final VideoDetailController? videoDetailCtr;
|
final VideoDetailController? videoDetailCtr;
|
||||||
final Floating? floating;
|
final Floating? floating;
|
||||||
|
final String? bvid;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HeaderControl> createState() => _HeaderControlState();
|
State<HeaderControl> createState() => _HeaderControlState();
|
||||||
@ -62,7 +64,8 @@ class _HeaderControlState extends State<HeaderControl> {
|
|||||||
speedsList = widget.controller!.speedsList;
|
speedsList = widget.controller!.speedsList;
|
||||||
fullScreenStatusListener();
|
fullScreenStatusListener();
|
||||||
heroTag = Get.arguments['heroTag'];
|
heroTag = Get.arguments['heroTag'];
|
||||||
videoIntroController = Get.put(VideoIntroController(), tag: heroTag);
|
videoIntroController =
|
||||||
|
Get.put(VideoIntroController(bvid: widget.bvid!), tag: heroTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void fullScreenStatusListener() {
|
void fullScreenStatusListener() {
|
||||||
|
|||||||
@ -51,27 +51,31 @@ class _WhisperDetailPageState extends State<WhisperDetailPage>
|
|||||||
@override
|
@override
|
||||||
void didChangeMetrics() {
|
void didChangeMetrics() {
|
||||||
super.didChangeMetrics();
|
super.didChangeMetrics();
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
final String routePath = Get.currentRoute;
|
||||||
// 键盘高度
|
if (mounted && routePath.startsWith('/whisper_detail')) {
|
||||||
final viewInsets = EdgeInsets.fromViewPadding(
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||||
View.of(context).viewInsets, View.of(context).devicePixelRatio);
|
// 键盘高度
|
||||||
_debouncer.run(() {
|
final viewInsets = EdgeInsets.fromViewPadding(
|
||||||
if (mounted) {
|
View.of(context).viewInsets, View.of(context).devicePixelRatio);
|
||||||
if (keyboardHeight == 0) {
|
_debouncer.run(() {
|
||||||
setState(() {
|
if (mounted) {
|
||||||
emoteHeight = keyboardHeight =
|
if (keyboardHeight == 0) {
|
||||||
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
setState(() {
|
||||||
});
|
emoteHeight = keyboardHeight =
|
||||||
|
keyboardHeight == 0.0 ? viewInsets.bottom : keyboardHeight;
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
WidgetsBinding.instance.removeObserver(this);
|
WidgetsBinding.instance.removeObserver(this);
|
||||||
replyContentFocusNode.removeListener(() {});
|
replyContentFocusNode.removeListener(() {});
|
||||||
|
replyContentFocusNode.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import 'package:hive/hive.dart';
|
|||||||
import 'package:media_kit/media_kit.dart';
|
import 'package:media_kit/media_kit.dart';
|
||||||
import 'package:media_kit_video/media_kit_video.dart';
|
import 'package:media_kit_video/media_kit_video.dart';
|
||||||
import 'package:nil/nil.dart';
|
import 'package:nil/nil.dart';
|
||||||
|
import 'package:pilipala/models/common/gesture_mode.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/controller.dart';
|
import 'package:pilipala/plugin/pl_player/controller.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/duration.dart';
|
import 'package:pilipala/plugin/pl_player/models/duration.dart';
|
||||||
import 'package:pilipala/plugin/pl_player/models/fullscreen_mode.dart';
|
import 'package:pilipala/plugin/pl_player/models/fullscreen_mode.dart';
|
||||||
@ -17,6 +18,7 @@ import 'package:pilipala/utils/feed_back.dart';
|
|||||||
import 'package:pilipala/utils/storage.dart';
|
import 'package:pilipala/utils/storage.dart';
|
||||||
import 'package:screen_brightness/screen_brightness.dart';
|
import 'package:screen_brightness/screen_brightness.dart';
|
||||||
|
|
||||||
|
import '../../utils/global_data.dart';
|
||||||
import 'models/bottom_progress_behavior.dart';
|
import 'models/bottom_progress_behavior.dart';
|
||||||
import 'widgets/app_bar_ani.dart';
|
import 'widgets/app_bar_ani.dart';
|
||||||
import 'widgets/backward_seek.dart';
|
import 'widgets/backward_seek.dart';
|
||||||
@ -73,6 +75,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
late bool enableQuickDouble;
|
late bool enableQuickDouble;
|
||||||
late bool enableBackgroundPlay;
|
late bool enableBackgroundPlay;
|
||||||
late double screenWidth;
|
late double screenWidth;
|
||||||
|
final FullScreenGestureMode fullScreenGestureMode =
|
||||||
|
GlobalData().fullScreenGestureMode;
|
||||||
|
|
||||||
// 用于记录上一次全屏切换手势触发时间,避免误触
|
// 用于记录上一次全屏切换手势触发时间,避免误触
|
||||||
DateTime? lastFullScreenToggleTime;
|
DateTime? lastFullScreenToggleTime;
|
||||||
@ -116,7 +120,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
super.initState();
|
super.initState();
|
||||||
screenWidth = Get.size.width;
|
screenWidth = Get.size.width;
|
||||||
animationController = AnimationController(
|
animationController = AnimationController(
|
||||||
vsync: this, duration: const Duration(milliseconds: 300));
|
vsync: this,
|
||||||
|
duration: GlobalData().enablePlayerControlAnimation
|
||||||
|
? const Duration(milliseconds: 150)
|
||||||
|
: const Duration(milliseconds: 10),
|
||||||
|
);
|
||||||
videoController = widget.controller.videoController!;
|
videoController = widget.controller.videoController!;
|
||||||
widget.controller.headerControl = widget.headerControl;
|
widget.controller.headerControl = widget.headerControl;
|
||||||
widget.controller.bottomControl = widget.bottomControl;
|
widget.controller.bottomControl = widget.bottomControl;
|
||||||
@ -520,18 +528,20 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
// 全屏
|
// 全屏
|
||||||
final double dy = details.delta.dy;
|
final double dy = details.delta.dy;
|
||||||
const double threshold = 7.0; // 滑动阈值
|
const double threshold = 7.0; // 滑动阈值
|
||||||
|
final bool flag =
|
||||||
|
fullScreenGestureMode != FullScreenGestureMode.values.last;
|
||||||
if (dy > _distance && dy > threshold) {
|
if (dy > _distance && dy > threshold) {
|
||||||
if (_.isFullScreen.value) {
|
if (_.isFullScreen.value ^ flag) {
|
||||||
lastFullScreenToggleTime = DateTime.now();
|
lastFullScreenToggleTime = DateTime.now();
|
||||||
// 下滑退出全屏
|
// 下滑退出全屏
|
||||||
await widget.controller.triggerFullScreen(status: false);
|
await widget.controller.triggerFullScreen(status: flag);
|
||||||
}
|
}
|
||||||
_distance = 0.0;
|
_distance = 0.0;
|
||||||
} else if (dy < _distance && dy < -threshold) {
|
} else if (dy < _distance && dy < -threshold) {
|
||||||
if (!_.isFullScreen.value) {
|
if (!_.isFullScreen.value ^ flag) {
|
||||||
lastFullScreenToggleTime = DateTime.now();
|
lastFullScreenToggleTime = DateTime.now();
|
||||||
// 上滑进入全屏
|
// 上滑进入全屏
|
||||||
await widget.controller.triggerFullScreen();
|
await widget.controller.triggerFullScreen(status: !flag);
|
||||||
}
|
}
|
||||||
_distance = 0.0;
|
_distance = 0.0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,11 +19,11 @@ class AppBarAni extends StatelessWidget implements PreferredSizeWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
visible ? controller.reverse() : controller.forward();
|
visible ? controller.forward() : controller.reverse();
|
||||||
return SlideTransition(
|
return SlideTransition(
|
||||||
position: Tween<Offset>(
|
position: Tween<Offset>(
|
||||||
begin: Offset.zero,
|
begin: Offset(0, position! == 'top' ? -1 : 1),
|
||||||
end: Offset(0, position! == 'top' ? -1 : 1),
|
end: Offset.zero,
|
||||||
).animate(CurvedAnimation(
|
).animate(CurvedAnimation(
|
||||||
parent: controller,
|
parent: controller,
|
||||||
curve: Curves.linear,
|
curve: Curves.linear,
|
||||||
|
|||||||
@ -39,6 +39,7 @@ import '../pages/setting/pages/color_select.dart';
|
|||||||
import '../pages/setting/pages/display_mode.dart';
|
import '../pages/setting/pages/display_mode.dart';
|
||||||
import '../pages/setting/pages/font_size_select.dart';
|
import '../pages/setting/pages/font_size_select.dart';
|
||||||
import '../pages/setting/pages/home_tabbar_set.dart';
|
import '../pages/setting/pages/home_tabbar_set.dart';
|
||||||
|
import '../pages/setting/pages/play_gesture_set.dart';
|
||||||
import '../pages/setting/pages/play_speed_set.dart';
|
import '../pages/setting/pages/play_speed_set.dart';
|
||||||
import '../pages/setting/recommend_setting.dart';
|
import '../pages/setting/recommend_setting.dart';
|
||||||
import '../pages/setting/play_setting.dart';
|
import '../pages/setting/play_setting.dart';
|
||||||
@ -166,6 +167,9 @@ class Routes {
|
|||||||
CustomGetPage(name: '/subscription', page: () => const SubPage()),
|
CustomGetPage(name: '/subscription', page: () => const SubPage()),
|
||||||
// 订阅详情
|
// 订阅详情
|
||||||
CustomGetPage(name: '/subDetail', page: () => const SubDetailPage()),
|
CustomGetPage(name: '/subDetail', page: () => const SubDetailPage()),
|
||||||
|
// 播放器手势
|
||||||
|
CustomGetPage(
|
||||||
|
name: '/playerGestureSet', page: () => const PlayGesturePage()),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -149,6 +149,8 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
|
|||||||
));
|
));
|
||||||
if (_item.isNotEmpty) {
|
if (_item.isNotEmpty) {
|
||||||
_item.removeLast();
|
_item.removeLast();
|
||||||
|
}
|
||||||
|
if (_item.isNotEmpty) {
|
||||||
setMediaItem(_item.last);
|
setMediaItem(_item.last);
|
||||||
}
|
}
|
||||||
if (_item.isEmpty) {
|
if (_item.isEmpty) {
|
||||||
|
|||||||
@ -1,5 +1,10 @@
|
|||||||
|
import '../models/common/index.dart';
|
||||||
|
|
||||||
class GlobalData {
|
class GlobalData {
|
||||||
int imgQuality = 10;
|
int imgQuality = 10;
|
||||||
|
FullScreenGestureMode fullScreenGestureMode =
|
||||||
|
FullScreenGestureMode.values.last;
|
||||||
|
bool enablePlayerControlAnimation = true;
|
||||||
|
|
||||||
// 私有构造函数
|
// 私有构造函数
|
||||||
GlobalData._();
|
GlobalData._();
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:path_provider/path_provider.dart';
|
|||||||
import 'package:pilipala/models/model_owner.dart';
|
import 'package:pilipala/models/model_owner.dart';
|
||||||
import 'package:pilipala/models/search/hot.dart';
|
import 'package:pilipala/models/search/hot.dart';
|
||||||
import 'package:pilipala/models/user/info.dart';
|
import 'package:pilipala/models/user/info.dart';
|
||||||
|
import '../models/common/gesture_mode.dart';
|
||||||
import 'global_data.dart';
|
import 'global_data.dart';
|
||||||
|
|
||||||
class GStrorage {
|
class GStrorage {
|
||||||
@ -45,6 +46,11 @@ class GStrorage {
|
|||||||
video = await Hive.openBox('video');
|
video = await Hive.openBox('video');
|
||||||
GlobalData().imgQuality =
|
GlobalData().imgQuality =
|
||||||
setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10); // 设置全局变量
|
setting.get(SettingBoxKey.defaultPicQa, defaultValue: 10); // 设置全局变量
|
||||||
|
GlobalData().fullScreenGestureMode = FullScreenGestureMode.values[
|
||||||
|
setting.get(SettingBoxKey.fullScreenGestureMode,
|
||||||
|
defaultValue: FullScreenGestureMode.values.last.index) as int];
|
||||||
|
GlobalData().enablePlayerControlAnimation = setting
|
||||||
|
.get(SettingBoxKey.enablePlayerControlAnimation, defaultValue: true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void regAdapter() {
|
static void regAdapter() {
|
||||||
@ -94,11 +100,13 @@ class SettingBoxKey {
|
|||||||
enableCDN = 'enableCDN',
|
enableCDN = 'enableCDN',
|
||||||
autoPiP = 'autoPiP',
|
autoPiP = 'autoPiP',
|
||||||
enableAutoLongPressSpeed = 'enableAutoLongPressSpeed',
|
enableAutoLongPressSpeed = 'enableAutoLongPressSpeed',
|
||||||
|
enablePlayerControlAnimation = 'enablePlayerControlAnimation',
|
||||||
|
|
||||||
// youtube 双击快进快退
|
// youtube 双击快进快退
|
||||||
enableQuickDouble = 'enableQuickDouble',
|
enableQuickDouble = 'enableQuickDouble',
|
||||||
enableShowDanmaku = 'enableShowDanmaku',
|
enableShowDanmaku = 'enableShowDanmaku',
|
||||||
enableBackgroundPlay = 'enableBackgroundPlay',
|
enableBackgroundPlay = 'enableBackgroundPlay',
|
||||||
|
fullScreenGestureMode = 'fullScreenGestureMode',
|
||||||
|
|
||||||
/// 隐私
|
/// 隐私
|
||||||
blackMidsList = 'blackMidsList',
|
blackMidsList = 'blackMidsList',
|
||||||
|
|||||||
Reference in New Issue
Block a user