Merge branch 'main' into opt-followUp

This commit is contained in:
guozhigq
2024-12-10 22:23:45 +08:00
20 changed files with 648 additions and 559 deletions

View File

@ -626,4 +626,7 @@ class Api {
/// 修复标题和海报 /// 修复标题和海报
// /api/view?id=${aid} /all/video/av${aid} /video/av${aid}/ // /api/view?id=${aid} /all/video/av${aid} /video/av${aid}/
static const String fixTitleAndPic = '${HttpString.biliplusBaseUrl}/api/view'; static const String fixTitleAndPic = '${HttpString.biliplusBaseUrl}/api/view';
/// 专栏详情
static const String opusDetail = '/x/polymer/web-dynamic/v1/opus/detail';
} }

View File

@ -215,4 +215,25 @@ class DynamicsHttp {
}; };
} }
} }
static Future opusDetail({
required int opusId,
}) async {
var res = await Request().get(
Api.opusDetail,
data: {'id': opusId},
);
if (res.data['code'] == 0) {
return {
'status': true,
'data': res.data['data'],
};
} else {
return {
'status': false,
'data': [],
'msg': res.data['message'],
};
}
}
} }

View File

@ -216,6 +216,21 @@ class BuildMainApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Box setting = GStorage.setting;
/// 纯黑模式主题配置
ColorScheme? pureDarkColorScheme;
final bool enablePureBlack =
setting.get(SettingBoxKey.enablePureBlack, defaultValue: false);
if (enablePureBlack) {
pureDarkColorScheme = darkColorScheme.copyWith(
background: Colors.black,
surface: Colors.black,
onPrimary: Colors.black,
onSecondary: Colors.black,
);
}
final SnackBarThemeData snackBarTheme = SnackBarThemeData( final SnackBarThemeData snackBarTheme = SnackBarThemeData(
actionTextColor: lightColorScheme.primary, actionTextColor: lightColorScheme.primary,
backgroundColor: lightColorScheme.secondaryContainer, backgroundColor: lightColorScheme.secondaryContainer,
@ -255,13 +270,13 @@ class BuildMainApp extends StatelessWidget {
title: 'PiliPala', title: 'PiliPala',
theme: buildThemeData( theme: buildThemeData(
currentThemeValue == ThemeType.dark currentThemeValue == ThemeType.dark
? darkColorScheme ? pureDarkColorScheme ?? darkColorScheme
: lightColorScheme, : lightColorScheme,
), ),
darkTheme: buildThemeData( darkTheme: buildThemeData(
currentThemeValue == ThemeType.light currentThemeValue == ThemeType.light
? lightColorScheme ? lightColorScheme
: darkColorScheme, : pureDarkColorScheme ?? darkColorScheme,
), ),
localizationsDelegates: const [ localizationsDelegates: const [
GlobalCupertinoLocalizations.delegate, GlobalCupertinoLocalizations.delegate,

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:pilipala/http/html.dart'; import 'package:pilipala/http/dynamics.dart';
import 'package:pilipala/http/reply.dart'; import 'package:pilipala/http/reply.dart';
import 'package:pilipala/models/common/reply_sort_type.dart'; import 'package:pilipala/models/common/reply_sort_type.dart';
import 'package:pilipala/models/video/reply/item.dart'; import 'package:pilipala/models/video/reply/item.dart';
@ -12,6 +12,7 @@ class DynamicDetailController extends GetxController {
DynamicDetailController(this.oid, this.type); DynamicDetailController(this.oid, this.type);
int? oid; int? oid;
int? type; int? type;
int? opusId;
dynamic item; dynamic item;
int? floor; int? floor;
String nextOffset = ""; String nextOffset = "";
@ -56,6 +57,12 @@ class DynamicDetailController extends GetxController {
if (reqType == 'init') { if (reqType == 'init') {
nextOffset = ''; nextOffset = '';
noMore.value = ''; noMore.value = '';
if (opusId != null && oid == 0) {
var res = await DynamicsHttp.opusDetail(opusId: opusId!);
if (res['status']) {
oid = int.parse(res['data']['item']['basic']['comment_id_str']);
}
}
} }
var res = await ReplyHttp.replyList( var res = await ReplyHttp.replyList(
oid: oid!, oid: oid!,
@ -110,15 +117,12 @@ class DynamicDetailController extends GetxController {
sortTypeTitle.value = _sortType.titles; sortTypeTitle.value = _sortType.titles;
sortTypeLabel.value = _sortType.labels; sortTypeLabel.value = _sortType.labels;
replyList.clear(); replyList.clear();
noMore.value = '';
isLoadingMore = false;
isEnd = false;
queryReplyList(reqType: 'init'); queryReplyList(reqType: 'init');
} }
// 根据jumpUrl获取动态html
reqHtmlByOpusId(int id) async {
var res = await HtmlHttp.reqHtml(id, 'opus');
oid = res['commentId'];
}
// 上拉加载 // 上拉加载
Future onLoad() async { Future onLoad() async {
queryReplyList(reqType: 'onLoad'); queryReplyList(reqType: 'onLoad');

View File

@ -89,9 +89,8 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
_dynamicDetailController = Get.put( _dynamicDetailController = Get.put(
DynamicDetailController(oid, replyType), DynamicDetailController(oid, replyType),
tag: opusId.toString()); tag: opusId.toString());
_dynamicDetailController.opusId = opusId;
_futureBuilderFuture = _dynamicDetailController.queryReplyList(); _futureBuilderFuture = _dynamicDetailController.queryReplyList();
await _dynamicDetailController.reqHtmlByOpusId(opusId!);
setState(() {});
} }
} else { } else {
oid = moduleDynamic.major!.draw!.id!; oid = moduleDynamic.major!.draw!.id!;

View File

@ -194,7 +194,10 @@ class _LivePageState extends State<LivePage>
), ),
), ),
), ),
InkWell( Obx(
() => Visibility(
visible: _liveController.liveFollowingCount.value > 0,
child: InkWell(
onTap: () { onTap: () {
Get.toNamed('/liveFollowing'); Get.toNamed('/liveFollowing');
}, },
@ -216,25 +219,26 @@ class _LivePageState extends State<LivePage>
], ],
), ),
), ),
),
),
], ],
), ),
FutureBuilder( FutureBuilder(
future: _futureBuilderFuture2, future: _futureBuilderFuture2,
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data == null) {
return const SizedBox();
}
Map? data = snapshot.data; Map? data = snapshot.data;
if (data?['status']) { if (data != null && data['status']) {
RxList list = _liveController.liveFollowingList; RxList list = _liveController.liveFollowingList;
return LiveFollowingListView(list: list); return list.isNotEmpty
? LiveFollowingListView(list: list)
: const Center(child: Text('没有人在直播'));
} else { } else {
return SizedBox( return SizedBox(
height: 80, height: 80,
child: Center( child: Center(
child: Text( child: Text(
data?['msg'] ?? '', data?['msg'] ?? '请求异常',
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
fontSize: 12, fontSize: 12,
@ -283,6 +287,15 @@ class LiveFollowingListView extends StatelessWidget {
}, },
); );
}, },
onLongPress: () {
Get.toNamed(
'/member?mid=${list[index].uid}',
arguments: {
'face': list[index].face,
'heroTag': list[index].uid.toString(),
},
);
},
child: Container( child: Container(
width: 54, width: 54,
height: 54, height: 54,

View File

@ -9,7 +9,7 @@ class LiveFollowController extends GetxController {
RxInt crossAxisCount = 2.obs; RxInt crossAxisCount = 2.obs;
Box setting = GStorage.setting; Box setting = GStorage.setting;
int _currentPage = 1; int _currentPage = 1;
RxInt liveFollowingCount = 0.obs; RxString liveFollowingCount = '- '.obs;
RxList<LiveFollowingItemModel> liveFollowingList = RxList<LiveFollowingItemModel> liveFollowingList =
<LiveFollowingItemModel>[].obs; <LiveFollowingItemModel>[].obs;
@ -28,10 +28,11 @@ class LiveFollowController extends GetxController {
if (res['status']) { if (res['status']) {
if (type == 'init') { if (type == 'init') {
liveFollowingList.value = res['data'].list; liveFollowingList.value = res['data'].list;
liveFollowingCount.value = res['data'].liveCount; liveFollowingCount.value = res['data'].liveCount.toString();
} else if (type == 'onLoad') { } else if (type == 'onLoad') {
liveFollowingList.addAll(res['data'].list); liveFollowingList.addAll(res['data'].list);
} }
liveFollowingList.removeWhere((e) => e.liveStatus != 1);
_currentPage += 1; _currentPage += 1;
} else { } else {
SmartDialog.showToast(res['msg']); SmartDialog.showToast(res['msg']);

View File

@ -110,7 +110,8 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
final mediaQuery = MediaQuery.of(context); final mediaQuery = MediaQuery.of(context);
final isPortrait = mediaQuery.orientation == Orientation.portrait; final isPortrait = mediaQuery.orientation == Orientation.portrait;
final isLandscape = mediaQuery.orientation == Orientation.landscape; final RxBool isLandscape =
(mediaQuery.orientation == Orientation.landscape).obs;
final padding = mediaQuery.padding; final padding = mediaQuery.padding;
@ -194,7 +195,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
Obx( Obx(
() => SizedBox( () => SizedBox(
height: padding.top + height: padding.top +
(_liveRoomController.isPortrait.value || isLandscape (_liveRoomController.isPortrait.value || isLandscape.value
? 0 ? 0
: kToolbarHeight), : kToolbarHeight),
), ),
@ -205,14 +206,14 @@ class _LiveRoomPageState extends State<LiveRoomPage>
if (plPlayerController.isFullScreen.value == true) { if (plPlayerController.isFullScreen.value == true) {
plPlayerController.triggerFullScreen(status: false); plPlayerController.triggerFullScreen(status: false);
} }
if (isLandscape) { if (isLandscape.value) {
verticalScreen(); verticalScreen();
} }
}, },
child: Obx( child: Obx(
() => Container( () => Container(
width: Get.size.width, width: Get.size.width,
height: isLandscape height: isLandscape.value
? Get.size.height ? Get.size.height
: !_liveRoomController.isPortrait.value : !_liveRoomController.isPortrait.value
? Get.size.width * 9 / 16 ? Get.size.width * 9 / 16
@ -313,7 +314,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
), ),
// 消息列表 // 消息列表
Visibility( Visibility(
visible: !isLandscape, visible: !isLandscape.value,
child: Obx( child: Obx(
() => Align( () => Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,

View File

@ -249,6 +249,15 @@ class _StyleSettingState extends State<StyleSetting> {
'当前模式:${settingController.themeType.value.description}', '当前模式:${settingController.themeType.value.description}',
style: subTitleStyle)), style: subTitleStyle)),
), ),
SetSwitchItem(
title: '纯黑模式',
subTitle: '深色模式时使用纯黑色背景适用于OLED屏幕',
setKey: SettingBoxKey.enablePureBlack,
defaultVal: false,
callFn: (bool val) => {
if (val && Get.isDarkMode) {Get.appUpdate()}
},
),
ListTile( ListTile(
dense: false, dense: false,
onTap: () => settingController.setDynamicBadgeMode(context), onTap: () => settingController.setDynamicBadgeMode(context),

View File

@ -276,7 +276,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
WidgetSpan( WidgetSpan(
child: Visibility( child: Visibility(
visible: widget.videoDetail!.copyright == 2, visible: widget.videoDetail!.copyright == 2,
child: const PBadge(text: '转载', type: 'color'), child: const PBadge(text: '转载', type: 'color', stack: 'relative'),
), ),
), ),
const TextSpan(text: ' '), const TextSpan(text: ' '),

View File

@ -73,7 +73,7 @@ class VideoReplyController extends GetxController {
/// 临时修复 /// 临时修复
final bool flag = replyList final bool flag = replyList
.any((ReplyItemModel reply) => reply.rpid == replies.first.rpid); .any((ReplyItemModel reply) => reply.rpid == replies.first.rpid);
if (replies.length == 1 && flag) { if (replies.length == 1 && flag && type == 'onLoad') {
replies.clear(); replies.clear();
isEnd = true; isEnd = true;
} }

View File

@ -196,7 +196,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
future: _futureBuilderFuture, future: _futureBuilderFuture,
builder: (BuildContext context, snapshot) { builder: (BuildContext context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) { if (snapshot.connectionState == ConnectionState.done) {
var data = snapshot.data; Map? data = snapshot.data;
if (_videoReplyController.replyList.isNotEmpty || if (_videoReplyController.replyList.isNotEmpty ||
(data != null && data['status'])) { (data != null && data['status'])) {
// 请求成功 // 请求成功
@ -258,7 +258,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
} else { } else {
// 请求错误 // 请求错误
return HttpError( return HttpError(
errMsg: data['msg'], errMsg: data?['msg'] ?? '请求异常',
fn: () { fn: () {
setState(() { setState(() {
_futureBuilderFuture = _futureBuilderFuture =

View File

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:math';
import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart'; import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:floating/floating.dart'; import 'package:floating/floating.dart';
@ -76,7 +77,7 @@ class _VideoDetailPageState extends State<VideoDetailPage>
getStatusHeight(); getStatusHeight();
heroTag = Get.arguments['heroTag']; heroTag = Get.arguments['heroTag'];
vdCtr = Get.put(VideoDetailController(), tag: heroTag); vdCtr = Get.put(VideoDetailController(), tag: heroTag);
vdCtr.sheetHeight.value = localCache.get('sheetHeight'); vdCtr.sheetHeight.value = GlobalDataCache.sheetHeight;
videoIntroController = Get.put( videoIntroController = Get.put(
VideoIntroController(bvid: Get.parameters['bvid']!), VideoIntroController(bvid: Get.parameters['bvid']!),
tag: heroTag); tag: heroTag);
@ -223,8 +224,8 @@ class _VideoDetailPageState extends State<VideoDetailPage>
void _extendNestCtrListener() { void _extendNestCtrListener() {
final double offset = _extendNestCtr.position.pixels; final double offset = _extendNestCtr.position.pixels;
if (vdCtr.videoDirection.value == 'horizontal') { if (vdCtr.videoDirection.value == 'horizontal') {
vdCtr.sheetHeight.value = vdCtr.sheetHeight.value = max(GlobalDataCache.sheetHeight,
Get.size.height - videoHeight - statusBarHeight + offset; Get.size.height - videoHeight - statusBarHeight + offset);
appbarStream.add(offset); appbarStream.add(offset);
} else { } else {
if (offset > (Get.size.width * 22 / 16 - videoHeight)) { if (offset > (Get.size.width * 22 / 16 - videoHeight)) {

View File

@ -1068,13 +1068,10 @@ class _HeaderControlState extends State<HeaderControl> {
); );
final bool isLandscape = final bool isLandscape =
MediaQuery.of(context).orientation == Orientation.landscape; MediaQuery.of(context).orientation == Orientation.landscape;
return AppBar( return Padding(
backgroundColor: Colors.transparent, padding: const EdgeInsets.symmetric(horizontal: 14),
foregroundColor: Colors.white, child: Column(
primary: false, mainAxisSize: MainAxisSize.min,
automaticallyImplyLeading: false,
titleSpacing: 14,
title: Column(
children: [ children: [
if (isFullScreen.value && isLandscape) ...[ if (isFullScreen.value && isLandscape) ...[
Row( Row(
@ -1083,10 +1080,7 @@ class _HeaderControlState extends State<HeaderControl> {
if (videoIntroController.isShowOnlineTotal) if (videoIntroController.isShowOnlineTotal)
Text( Text(
'${videoIntroController.total.value}人正在看', '${videoIntroController.total.value}人正在看',
style: const TextStyle( style: textStyle,
color: Colors.white,
fontSize: 12,
),
), ),
const Spacer(), const Spacer(),
Expanded( Expanded(
@ -1097,18 +1091,12 @@ class _HeaderControlState extends State<HeaderControl> {
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData) { if (snapshot.hasData) {
String currentTime = _formatTime(snapshot.data!); String currentTime = _formatTime(snapshot.data!);
return Text( return Text(currentTime, style: textStyle);
currentTime,
style: const TextStyle(fontSize: 12),
);
} else if (snapshot.connectionState == } else if (snapshot.connectionState ==
ConnectionState.waiting) { ConnectionState.waiting) {
// 如果Stream还未发出数据先显示初始获取的时间 // 如果Stream还未发出数据先显示初始获取的时间
String currentTime = _formatTime(initialTime); String currentTime = _formatTime(initialTime);
return Text( return Text(currentTime, style: textStyle);
currentTime,
style: const TextStyle(fontSize: 12),
);
} else { } else {
return const SizedBox(); return const SizedBox();
} }
@ -1159,7 +1147,8 @@ class _HeaderControlState extends State<HeaderControl> {
() => Marquee( () => Marquee(
text: videoIntroController.videoDetail.value.title ?? text: videoIntroController.videoDetail.value.title ??
'', '',
style: const TextStyle(fontSize: 16), style: const TextStyle(
fontSize: 16, color: Colors.white),
scrollAxis: Axis.horizontal, scrollAxis: Axis.horizontal,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
blankSpace: constraints.maxWidth, blankSpace: constraints.maxWidth,

View File

@ -45,6 +45,7 @@ class WhisperController extends GetxController {
if (isLoading) return; if (isLoading) return;
var res = await MsgHttp.sessionList( var res = await MsgHttp.sessionList(
endTs: type == 'onLoad' ? sessionList.last.sessionTs : null); endTs: type == 'onLoad' ? sessionList.last.sessionTs : null);
try {
if (res['status'] && if (res['status'] &&
res['data'].sessionList != null && res['data'].sessionList != null &&
res['data'].sessionList.isNotEmpty) { res['data'].sessionList.isNotEmpty) {
@ -75,6 +76,13 @@ class WhisperController extends GetxController {
sessionList.value = res['data'].sessionList; sessionList.value = res['data'].sessionList;
} }
} }
} catch (err) {
res = {
'status': false,
'message': err.toString(),
};
}
isLoading = false; isLoading = false;
return res; return res;
} }

View File

@ -44,7 +44,24 @@ class _WhisperPageState extends State<WhisperPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(title: const Text('消息')), appBar: AppBar(
title: const Text('消息'),
actions: [
IconButton(
icon: Icon(Icons.open_in_browser_rounded,
color: Theme.of(context).colorScheme.primary),
tooltip: '用浏览器打开',
onPressed: () {
Get.toNamed('/webview', parameters: {
'url': 'https://message.bilibili.com',
'type': 'whisper',
'pageTitle': '消息中心',
});
},
),
const SizedBox(width: 12)
],
),
body: RefreshIndicator( body: RefreshIndicator(
onRefresh: () async { onRefresh: () async {
_whisperController.unread(); _whisperController.unread();

View File

@ -521,6 +521,7 @@ class SystemNotice extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
Map content = item.content ?? ''; Map content = item.content ?? '';
Color primary = Theme.of(context).colorScheme.primary;
return Row( return Row(
children: [ children: [
const SizedBox(width: 12), const SizedBox(width: 12),
@ -557,12 +558,35 @@ class SystemNotice extends StatelessWidget {
.labelSmall! .labelSmall!
.copyWith(color: Theme.of(context).colorScheme.outline), .copyWith(color: Theme.of(context).colorScheme.outline),
), ),
Divider( Divider(color: primary.withOpacity(0.05)),
color: Theme.of(context).colorScheme.primary.withOpacity(0.05), SelectableText(content['text']),
if (content['jump_text'] != null &&
content['jump_uri'] != null) ...[
Divider(color: primary.withOpacity(0.05)),
Align(
alignment: Alignment.center,
child: TextButton(
onPressed: () {
Get.toNamed('/webview', parameters: {
'url': content['jump_uri'],
'type': 'url',
'pageTitle': content['jump_text'] == ''
? '查看详情'
: content['jump_text'],
});
},
style: ButtonStyle(
backgroundColor:
MaterialStateProperty.resolveWith((states) {
return primary.withAlpha(20);
}),
), ),
SelectableText( child: Text(content['jump_text'] == ''
content['text'], ? '查看详情'
) : content['jump_text']),
),
),
]
], ],
), ),
), ),

View File

@ -292,10 +292,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
style: ButtonStyle( style: ButtonStyle(
padding: MaterialStateProperty.all(EdgeInsets.zero), padding: MaterialStateProperty.all(EdgeInsets.zero),
), ),
child: const Text( child: const Text('选集', style: textStyle),
'选集',
style: TextStyle(color: Colors.white, fontSize: 13),
),
), ),
), ),
@ -310,14 +307,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
padding: MaterialStateProperty.all(EdgeInsets.zero), padding: MaterialStateProperty.all(EdgeInsets.zero),
), ),
child: Obx( child: Obx(
() => Text( () => Text(_.videoFitDEsc.value, style: textStyle),
_.videoFitDEsc.value,
style: const TextStyle(
color: Colors.white,
fontSize: 12,
fontWeight: FontWeight.bold,
),
),
), ),
), ),
), ),
@ -339,10 +329,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
height: 40, height: 40,
padding: const EdgeInsets.only(left: 20), padding: const EdgeInsets.only(left: 20),
value: speed, value: speed,
child: Text( child: Text('${speed}x', style: textStyle),
'${speed}x',
style: textStyle.copyWith(fontWeight: FontWeight.bold),
),
); );
}).toList(); }).toList();
}, },
@ -352,10 +339,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
alignment: Alignment.center, alignment: Alignment.center,
margin: const EdgeInsets.only(right: 4), margin: const EdgeInsets.only(right: 4),
child: Obx( child: Obx(
() => Text( () => Text('${_.playbackSpeed.toString()}x', style: textStyle),
'${_.playbackSpeed.toString()}x',
style: textStyle.copyWith(fontWeight: FontWeight.bold),
),
), ),
), ),
), ),
@ -443,7 +427,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
); );
return Stack( return ClipRect(
child: Stack(
fit: StackFit.passthrough, fit: StackFit.passthrough,
children: <Widget>[ children: <Widget>[
Obx( Obx(
@ -719,7 +704,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
_brightnessValue.value - delta / level; _brightnessValue.value - delta / level;
final double result = brightness.clamp(0.0, 1.0); final double result = brightness.clamp(0.0, 1.0);
setBrightness(result); setBrightness(result);
} else if (isUsingFullScreenGestures(tapPosition, sectionWidth)) { } else if (isUsingFullScreenGestures(
tapPosition, sectionWidth)) {
// 全屏 // 全屏
final double dy = details.delta.dy; final double dy = details.delta.dy;
const double threshold = 7.0; // 滑动阈值 const double threshold = 7.0; // 滑动阈值
@ -770,9 +756,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
() => Column( () => Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
if (widget.headerControl != null || _.headerControl != null) ...[ if (widget.headerControl != null ||
_.headerControl != null) ...[
Flexible( Flexible(
child: ClipRect(
child: AppBarAni( child: AppBarAni(
controller: animationController, controller: animationController,
visible: !_.controlsLock.value && _.showControls.value, visible: !_.controlsLock.value && _.showControls.value,
@ -780,13 +766,11 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
child: widget.headerControl ?? _.headerControl!, child: widget.headerControl ?? _.headerControl!,
), ),
), ),
),
] else ...[ ] else ...[
const SizedBox.shrink() const SizedBox.shrink()
], ],
Flexible( Flexible(
flex: _.videoType == 'live' ? 0 : 1, flex: _.videoType == 'live' ? 0 : 1,
child: ClipRect(
child: AppBarAni( child: AppBarAni(
controller: animationController, controller: animationController,
visible: !_.controlsLock.value && _.showControls.value, visible: !_.controlsLock.value && _.showControls.value,
@ -799,7 +783,6 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
), ),
), ),
), ),
),
], ],
), ),
), ),
@ -934,6 +917,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
onSubmittedcb: _handleSubmittedCallback, onSubmittedcb: _handleSubmittedCallback,
), ),
], ],
),
); );
} }
} }

View File

@ -18,19 +18,18 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Padding(
color: Colors.transparent,
height: 90,
padding: const EdgeInsets.symmetric(horizontal: 18), padding: const EdgeInsets.symmetric(horizontal: 18),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [ children: [
Padding( Padding(
padding: const EdgeInsets.fromLTRB(7, 0, 7, 6), padding: const EdgeInsets.fromLTRB(7, 0, 7, 4),
child: ProgressBarWidget(controller: controller!), child: ProgressBarWidget(controller: controller!),
), ),
Row(children: buildBottomControl!), Row(children: buildBottomControl!),
const SizedBox(height: 10), const SizedBox(height: 6),
], ],
), ),
); );

View File

@ -137,7 +137,8 @@ class SettingBoxKey {
enableGradientBg = 'enableGradientBg', enableGradientBg = 'enableGradientBg',
enableDynamicSwitch = 'enableDynamicSwitch', enableDynamicSwitch = 'enableDynamicSwitch',
navBarSort = 'navBarSort', navBarSort = 'navBarSort',
actionTypeSort = 'actionTypeSort'; actionTypeSort = 'actionTypeSort',
enablePureBlack = 'enablePureBlack';
} }
class LocalCacheKey { class LocalCacheKey {