Merge branch 'main' into design
This commit is contained in:
@ -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';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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');
|
||||||
|
|||||||
@ -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!;
|
||||||
|
|||||||
@ -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,
|
||||||
|
|||||||
@ -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),
|
||||||
|
|||||||
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
@ -443,336 +443,336 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
fontSize: 12,
|
fontSize: 12,
|
||||||
);
|
);
|
||||||
return Stack(
|
return ClipRect(
|
||||||
fit: StackFit.passthrough,
|
child: Stack(
|
||||||
children: <Widget>[
|
fit: StackFit.passthrough,
|
||||||
Obx(
|
children: <Widget>[
|
||||||
() => Video(
|
Obx(
|
||||||
key: ValueKey(_.videoFit.value),
|
() => Video(
|
||||||
controller: videoController,
|
key: ValueKey(_.videoFit.value),
|
||||||
controls: NoVideoControls,
|
controller: videoController,
|
||||||
alignment: widget.alignment!,
|
controls: NoVideoControls,
|
||||||
pauseUponEnteringBackgroundMode: !enableBackgroundPlay,
|
alignment: widget.alignment!,
|
||||||
resumeUponEnteringForegroundMode: true,
|
pauseUponEnteringBackgroundMode: !enableBackgroundPlay,
|
||||||
subtitleViewConfiguration: const SubtitleViewConfiguration(
|
resumeUponEnteringForegroundMode: true,
|
||||||
style: subTitleStyle,
|
subtitleViewConfiguration: const SubtitleViewConfiguration(
|
||||||
padding: EdgeInsets.all(24.0),
|
style: subTitleStyle,
|
||||||
|
padding: EdgeInsets.all(24.0),
|
||||||
|
),
|
||||||
|
fit: _.videoFit.value,
|
||||||
),
|
),
|
||||||
fit: _.videoFit.value,
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
/// 长按倍速 toast
|
/// 长按倍速 toast
|
||||||
Obx(
|
Obx(
|
||||||
() => Align(
|
() => Align(
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: FractionalTranslation(
|
child: FractionalTranslation(
|
||||||
translation: const Offset(0.0, 0.3), // 上下偏移量(负数向上偏移)
|
translation: const Offset(0.0, 0.3), // 上下偏移量(负数向上偏移)
|
||||||
child: AnimatedOpacity(
|
child: AnimatedOpacity(
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
opacity: _.doubleSpeedStatus.value ? 1.0 : 0.0,
|
opacity: _.doubleSpeedStatus.value ? 1.0 : 0.0,
|
||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0x88000000),
|
color: const Color(0x88000000),
|
||||||
borderRadius: BorderRadius.circular(16.0),
|
borderRadius: BorderRadius.circular(16.0),
|
||||||
),
|
|
||||||
height: 32.0,
|
|
||||||
width: 70.0,
|
|
||||||
child: const Center(
|
|
||||||
child: Text(
|
|
||||||
'倍速中',
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 13),
|
|
||||||
),
|
),
|
||||||
)),
|
height: 32.0,
|
||||||
|
width: 70.0,
|
||||||
|
child: const Center(
|
||||||
|
child: Text(
|
||||||
|
'倍速中',
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 13),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
/// 时间进度 toast
|
/// 时间进度 toast
|
||||||
Obx(
|
Obx(
|
||||||
() => Align(
|
() => Align(
|
||||||
alignment: Alignment.topCenter,
|
alignment: Alignment.topCenter,
|
||||||
child: FractionalTranslation(
|
child: FractionalTranslation(
|
||||||
translation: const Offset(0.0, 1.0), // 上下偏移量(负数向上偏移)
|
translation: const Offset(0.0, 1.0), // 上下偏移量(负数向上偏移)
|
||||||
child: AnimatedOpacity(
|
child: AnimatedOpacity(
|
||||||
curve: Curves.easeInOut,
|
curve: Curves.easeInOut,
|
||||||
opacity: _.isSliderMoving.value ? 1.0 : 0.0,
|
opacity: _.isSliderMoving.value ? 1.0 : 0.0,
|
||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
child: IntrinsicWidth(
|
child: IntrinsicWidth(
|
||||||
child: Container(
|
child: Container(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: const Color(0x88000000),
|
color: const Color(0x88000000),
|
||||||
borderRadius: BorderRadius.circular(64.0),
|
borderRadius: BorderRadius.circular(64.0),
|
||||||
),
|
),
|
||||||
height: 34.0,
|
height: 34.0,
|
||||||
padding: const EdgeInsets.only(left: 10, right: 10),
|
padding: const EdgeInsets.only(left: 10, right: 10),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Obx(() {
|
Obx(() {
|
||||||
return Text(
|
return Text(
|
||||||
_.sliderTempPosition.value.inMinutes >= 60
|
_.sliderTempPosition.value.inMinutes >= 60
|
||||||
? printDurationWithHours(
|
? printDurationWithHours(
|
||||||
_.sliderTempPosition.value)
|
_.sliderTempPosition.value)
|
||||||
: printDuration(_.sliderTempPosition.value),
|
: printDuration(_.sliderTempPosition.value),
|
||||||
style: textStyle,
|
style: textStyle,
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
const SizedBox(width: 2),
|
const SizedBox(width: 2),
|
||||||
const Text('/', style: textStyle),
|
const Text('/', style: textStyle),
|
||||||
const SizedBox(width: 2),
|
const SizedBox(width: 2),
|
||||||
Obx(
|
Obx(
|
||||||
() => Text(
|
() => Text(
|
||||||
_.duration.value.inMinutes >= 60
|
_.duration.value.inMinutes >= 60
|
||||||
? printDurationWithHours(_.duration.value)
|
? printDurationWithHours(_.duration.value)
|
||||||
: printDuration(_.duration.value),
|
: printDuration(_.duration.value),
|
||||||
style: textStyle,
|
style: textStyle,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
/// 音量🔊 控制条展示
|
/// 音量🔊 控制条展示
|
||||||
Obx(
|
Obx(
|
||||||
() => ControlBar(
|
() => ControlBar(
|
||||||
visible: _volumeIndicator.value,
|
visible: _volumeIndicator.value,
|
||||||
icon: _volumeValue.value < 1.0 / 3.0
|
icon: _volumeValue.value < 1.0 / 3.0
|
||||||
? Icons.volume_mute
|
? Icons.volume_mute
|
||||||
: _volumeValue.value < 2.0 / 3.0
|
: _volumeValue.value < 2.0 / 3.0
|
||||||
? Icons.volume_down
|
? Icons.volume_down
|
||||||
: Icons.volume_up,
|
: Icons.volume_up,
|
||||||
value: _volumeValue.value,
|
value: _volumeValue.value,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
/// 亮度🌞 控制条展示
|
/// 亮度🌞 控制条展示
|
||||||
Obx(
|
Obx(
|
||||||
() => ControlBar(
|
() => ControlBar(
|
||||||
visible: _brightnessIndicator.value,
|
visible: _brightnessIndicator.value,
|
||||||
icon: _brightnessValue.value < 1.0 / 3.0
|
icon: _brightnessValue.value < 1.0 / 3.0
|
||||||
? Icons.brightness_low
|
? Icons.brightness_low
|
||||||
: _brightnessValue.value < 2.0 / 3.0
|
: _brightnessValue.value < 2.0 / 3.0
|
||||||
? Icons.brightness_medium
|
? Icons.brightness_medium
|
||||||
: Icons.brightness_high,
|
: Icons.brightness_high,
|
||||||
value: _brightnessValue.value,
|
value: _brightnessValue.value,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
// Obx(() {
|
// Obx(() {
|
||||||
// if (_.buffered.value == Duration.zero) {
|
// if (_.buffered.value == Duration.zero) {
|
||||||
// return Positioned.fill(
|
// return Positioned.fill(
|
||||||
// child: Container(
|
// child: Container(
|
||||||
// color: Colors.black,
|
// color: Colors.black,
|
||||||
// child: Center(
|
// child: Center(
|
||||||
// child: Image.asset(
|
// child: Image.asset(
|
||||||
// 'assets/images/loading.gif',
|
// 'assets/images/loading.gif',
|
||||||
// height: 25,
|
// height: 25,
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// ),
|
// ),
|
||||||
// );
|
// );
|
||||||
// } else {
|
// } else {
|
||||||
// return Container();
|
// return Container();
|
||||||
// }
|
// }
|
||||||
// }),
|
// }),
|
||||||
|
|
||||||
/// 弹幕面板
|
/// 弹幕面板
|
||||||
if (widget.danmuWidget != null)
|
if (widget.danmuWidget != null)
|
||||||
Positioned.fill(top: 4, child: widget.danmuWidget!),
|
Positioned.fill(top: 4, child: widget.danmuWidget!),
|
||||||
|
|
||||||
/// 开启且有字幕时展示
|
/// 开启且有字幕时展示
|
||||||
Stack(
|
Stack(
|
||||||
children: [
|
children: [
|
||||||
Positioned(
|
Positioned(
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
bottom: 30,
|
bottom: 30,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
child: Obx(
|
child: Obx(
|
||||||
() => Visibility(
|
() => Visibility(
|
||||||
visible: widget.controller.subTitleCode.value != -1,
|
visible: widget.controller.subTitleCode.value != -1,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(4),
|
borderRadius: BorderRadius.circular(4),
|
||||||
color: widget.controller.subtitleContent.value != ''
|
color: widget.controller.subtitleContent.value != ''
|
||||||
? Colors.black.withOpacity(0.6)
|
? Colors.black.withOpacity(0.6)
|
||||||
: Colors.transparent,
|
: Colors.transparent,
|
||||||
),
|
|
||||||
padding: widget.controller.subTitleCode.value != -1
|
|
||||||
? const EdgeInsets.symmetric(
|
|
||||||
horizontal: 10,
|
|
||||||
vertical: 4,
|
|
||||||
)
|
|
||||||
: EdgeInsets.zero,
|
|
||||||
child: Text(
|
|
||||||
widget.controller.subtitleContent.value,
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white,
|
|
||||||
fontSize: 12,
|
|
||||||
),
|
),
|
||||||
),
|
padding: widget.controller.subTitleCode.value != -1
|
||||||
)),
|
? const EdgeInsets.symmetric(
|
||||||
|
horizontal: 10,
|
||||||
|
vertical: 4,
|
||||||
|
)
|
||||||
|
: EdgeInsets.zero,
|
||||||
|
child: Text(
|
||||||
|
widget.controller.subtitleContent.value,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
|
||||||
),
|
|
||||||
|
|
||||||
/// 手势
|
|
||||||
Positioned.fill(
|
|
||||||
left: 16,
|
|
||||||
top: 25,
|
|
||||||
right: 15,
|
|
||||||
bottom: 15,
|
|
||||||
child: GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
_.controls = !_.showControls.value;
|
|
||||||
},
|
|
||||||
onDoubleTapDown: (TapDownDetails details) {
|
|
||||||
// live模式下禁用 锁定时🔒禁用
|
|
||||||
if (_.videoType == 'live' || _.controlsLock.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final double totalWidth = MediaQuery.sizeOf(context).width;
|
|
||||||
final double tapPosition = details.localPosition.dx;
|
|
||||||
final double sectionWidth = totalWidth / 3;
|
|
||||||
String type = 'left';
|
|
||||||
if (tapPosition < sectionWidth) {
|
|
||||||
type = 'left';
|
|
||||||
} else if (tapPosition < sectionWidth * 2) {
|
|
||||||
type = 'center';
|
|
||||||
} else {
|
|
||||||
type = 'right';
|
|
||||||
}
|
|
||||||
doubleTapFuc(type);
|
|
||||||
},
|
|
||||||
onLongPressStart: (LongPressStartDetails detail) {
|
|
||||||
feedBack();
|
|
||||||
_.setDoubleSpeedStatus(true);
|
|
||||||
},
|
|
||||||
onLongPressEnd: (LongPressEndDetails details) {
|
|
||||||
_.setDoubleSpeedStatus(false);
|
|
||||||
},
|
|
||||||
|
|
||||||
/// 水平位置 快进 live模式下禁用
|
|
||||||
onHorizontalDragUpdate: (DragUpdateDetails details) {
|
|
||||||
// live模式下禁用 锁定时🔒禁用
|
|
||||||
if (_.videoType == 'live' || _.controlsLock.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// final double tapPosition = details.localPosition.dx;
|
|
||||||
final int curSliderPosition =
|
|
||||||
_.sliderPosition.value.inMilliseconds;
|
|
||||||
final double scale = 90000 / MediaQuery.sizeOf(context).width;
|
|
||||||
final Duration pos = Duration(
|
|
||||||
milliseconds:
|
|
||||||
curSliderPosition + (details.delta.dx * scale).round());
|
|
||||||
final Duration result =
|
|
||||||
pos.clamp(Duration.zero, _.duration.value);
|
|
||||||
_.onUpdatedSliderProgress(result);
|
|
||||||
_.onChangedSliderStart();
|
|
||||||
},
|
|
||||||
onHorizontalDragEnd: (DragEndDetails details) {
|
|
||||||
if (_.videoType == 'live' || _.controlsLock.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_.onChangedSliderEnd();
|
|
||||||
_.seekTo(_.sliderPosition.value, type: 'slider');
|
|
||||||
},
|
|
||||||
// 垂直方向 音量/亮度调节
|
|
||||||
onVerticalDragUpdate: (DragUpdateDetails details) async {
|
|
||||||
final double totalWidth = MediaQuery.sizeOf(context).width;
|
|
||||||
final double tapPosition = details.localPosition.dx;
|
|
||||||
final double sectionWidth =
|
|
||||||
fullScreenGestureMode == FullScreenGestureMode.none
|
|
||||||
? totalWidth / 2
|
|
||||||
: totalWidth / 3;
|
|
||||||
final double delta = details.delta.dy;
|
|
||||||
|
|
||||||
/// 锁定时禁用
|
|
||||||
if (_.controlsLock.value) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (lastFullScreenToggleTime != null &&
|
|
||||||
DateTime.now().difference(lastFullScreenToggleTime!) <
|
|
||||||
const Duration(milliseconds: 500)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (tapPosition < sectionWidth) {
|
|
||||||
// 左边区域 👈
|
|
||||||
final double level = (_.isFullScreen.value
|
|
||||||
? Get.size.height
|
|
||||||
: screenWidth * 9 / 16) *
|
|
||||||
3;
|
|
||||||
final double brightness =
|
|
||||||
_brightnessValue.value - delta / level;
|
|
||||||
final double result = brightness.clamp(0.0, 1.0);
|
|
||||||
setBrightness(result);
|
|
||||||
} else if (isUsingFullScreenGestures(tapPosition, sectionWidth)) {
|
|
||||||
// 全屏
|
|
||||||
final double dy = details.delta.dy;
|
|
||||||
const double threshold = 7.0; // 滑动阈值
|
|
||||||
final bool flag = fullScreenGestureMode !=
|
|
||||||
FullScreenGestureMode.fromBottomtoTop;
|
|
||||||
if (dy > _distance.value &&
|
|
||||||
dy > threshold &&
|
|
||||||
!_.controlsLock.value) {
|
|
||||||
if (_.isFullScreen.value ^ flag) {
|
|
||||||
lastFullScreenToggleTime = DateTime.now();
|
|
||||||
// 下滑退出全屏
|
|
||||||
await widget.controller.triggerFullScreen(status: flag);
|
|
||||||
widget.fullScreenCb?.call(flag);
|
|
||||||
}
|
|
||||||
_distance.value = 0.0;
|
|
||||||
} else if (dy < _distance.value &&
|
|
||||||
dy < -threshold &&
|
|
||||||
!_.controlsLock.value) {
|
|
||||||
if (!_.isFullScreen.value ^ flag) {
|
|
||||||
lastFullScreenToggleTime = DateTime.now();
|
|
||||||
// 上滑进入全屏
|
|
||||||
await widget.controller.triggerFullScreen(status: !flag);
|
|
||||||
widget.fullScreenCb?.call(!flag);
|
|
||||||
}
|
|
||||||
_distance.value = 0.0;
|
|
||||||
}
|
|
||||||
_distance.value = dy;
|
|
||||||
} else {
|
|
||||||
// 右边区域 👈
|
|
||||||
EasyThrottle.throttle(
|
|
||||||
'setVolume', const Duration(milliseconds: 20), () {
|
|
||||||
final double level = (_.isFullScreen.value
|
|
||||||
? Get.size.height
|
|
||||||
: screenWidth * 9 / 16);
|
|
||||||
final double volume = _volumeValue.value -
|
|
||||||
double.parse(delta.toStringAsFixed(1)) / level;
|
|
||||||
final double result = volume.clamp(0.0, 1.0);
|
|
||||||
setVolume(result);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onVerticalDragEnd: (DragEndDetails details) {},
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
// 头部、底部控制条
|
/// 手势
|
||||||
Obx(
|
Positioned.fill(
|
||||||
() => Column(
|
left: 16,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
top: 25,
|
||||||
children: [
|
right: 15,
|
||||||
if (widget.headerControl != null || _.headerControl != null) ...[
|
bottom: 15,
|
||||||
Flexible(
|
child: GestureDetector(
|
||||||
child: ClipRect(
|
onTap: () {
|
||||||
|
_.controls = !_.showControls.value;
|
||||||
|
},
|
||||||
|
onDoubleTapDown: (TapDownDetails details) {
|
||||||
|
// live模式下禁用 锁定时🔒禁用
|
||||||
|
if (_.videoType == 'live' || _.controlsLock.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final double totalWidth = MediaQuery.sizeOf(context).width;
|
||||||
|
final double tapPosition = details.localPosition.dx;
|
||||||
|
final double sectionWidth = totalWidth / 3;
|
||||||
|
String type = 'left';
|
||||||
|
if (tapPosition < sectionWidth) {
|
||||||
|
type = 'left';
|
||||||
|
} else if (tapPosition < sectionWidth * 2) {
|
||||||
|
type = 'center';
|
||||||
|
} else {
|
||||||
|
type = 'right';
|
||||||
|
}
|
||||||
|
doubleTapFuc(type);
|
||||||
|
},
|
||||||
|
onLongPressStart: (LongPressStartDetails detail) {
|
||||||
|
feedBack();
|
||||||
|
_.setDoubleSpeedStatus(true);
|
||||||
|
},
|
||||||
|
onLongPressEnd: (LongPressEndDetails details) {
|
||||||
|
_.setDoubleSpeedStatus(false);
|
||||||
|
},
|
||||||
|
|
||||||
|
/// 水平位置 快进 live模式下禁用
|
||||||
|
onHorizontalDragUpdate: (DragUpdateDetails details) {
|
||||||
|
// live模式下禁用 锁定时🔒禁用
|
||||||
|
if (_.videoType == 'live' || _.controlsLock.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// final double tapPosition = details.localPosition.dx;
|
||||||
|
final int curSliderPosition =
|
||||||
|
_.sliderPosition.value.inMilliseconds;
|
||||||
|
final double scale = 90000 / MediaQuery.sizeOf(context).width;
|
||||||
|
final Duration pos = Duration(
|
||||||
|
milliseconds:
|
||||||
|
curSliderPosition + (details.delta.dx * scale).round());
|
||||||
|
final Duration result =
|
||||||
|
pos.clamp(Duration.zero, _.duration.value);
|
||||||
|
_.onUpdatedSliderProgress(result);
|
||||||
|
_.onChangedSliderStart();
|
||||||
|
},
|
||||||
|
onHorizontalDragEnd: (DragEndDetails details) {
|
||||||
|
if (_.videoType == 'live' || _.controlsLock.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_.onChangedSliderEnd();
|
||||||
|
_.seekTo(_.sliderPosition.value, type: 'slider');
|
||||||
|
},
|
||||||
|
// 垂直方向 音量/亮度调节
|
||||||
|
onVerticalDragUpdate: (DragUpdateDetails details) async {
|
||||||
|
final double totalWidth = MediaQuery.sizeOf(context).width;
|
||||||
|
final double tapPosition = details.localPosition.dx;
|
||||||
|
final double sectionWidth =
|
||||||
|
fullScreenGestureMode == FullScreenGestureMode.none
|
||||||
|
? totalWidth / 2
|
||||||
|
: totalWidth / 3;
|
||||||
|
final double delta = details.delta.dy;
|
||||||
|
|
||||||
|
/// 锁定时禁用
|
||||||
|
if (_.controlsLock.value) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (lastFullScreenToggleTime != null &&
|
||||||
|
DateTime.now().difference(lastFullScreenToggleTime!) <
|
||||||
|
const Duration(milliseconds: 500)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tapPosition < sectionWidth) {
|
||||||
|
// 左边区域 👈
|
||||||
|
final double level = (_.isFullScreen.value
|
||||||
|
? Get.size.height
|
||||||
|
: screenWidth * 9 / 16) *
|
||||||
|
3;
|
||||||
|
final double brightness =
|
||||||
|
_brightnessValue.value - delta / level;
|
||||||
|
final double result = brightness.clamp(0.0, 1.0);
|
||||||
|
setBrightness(result);
|
||||||
|
} else if (isUsingFullScreenGestures(
|
||||||
|
tapPosition, sectionWidth)) {
|
||||||
|
// 全屏
|
||||||
|
final double dy = details.delta.dy;
|
||||||
|
const double threshold = 7.0; // 滑动阈值
|
||||||
|
final bool flag = fullScreenGestureMode !=
|
||||||
|
FullScreenGestureMode.fromBottomtoTop;
|
||||||
|
if (dy > _distance.value &&
|
||||||
|
dy > threshold &&
|
||||||
|
!_.controlsLock.value) {
|
||||||
|
if (_.isFullScreen.value ^ flag) {
|
||||||
|
lastFullScreenToggleTime = DateTime.now();
|
||||||
|
// 下滑退出全屏
|
||||||
|
await widget.controller.triggerFullScreen(status: flag);
|
||||||
|
}
|
||||||
|
_distance.value = 0.0;
|
||||||
|
} else if (dy < _distance.value &&
|
||||||
|
dy < -threshold &&
|
||||||
|
!_.controlsLock.value) {
|
||||||
|
if (!_.isFullScreen.value ^ flag) {
|
||||||
|
lastFullScreenToggleTime = DateTime.now();
|
||||||
|
// 上滑进入全屏
|
||||||
|
await widget.controller.triggerFullScreen(status: !flag);
|
||||||
|
}
|
||||||
|
_distance.value = 0.0;
|
||||||
|
}
|
||||||
|
_distance.value = dy;
|
||||||
|
} else {
|
||||||
|
// 右边区域 👈
|
||||||
|
EasyThrottle.throttle(
|
||||||
|
'setVolume', const Duration(milliseconds: 20), () {
|
||||||
|
final double level = (_.isFullScreen.value
|
||||||
|
? Get.size.height
|
||||||
|
: screenWidth * 9 / 16);
|
||||||
|
final double volume = _volumeValue.value -
|
||||||
|
double.parse(delta.toStringAsFixed(1)) / level;
|
||||||
|
final double result = volume.clamp(0.0, 1.0);
|
||||||
|
setVolume(result);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onVerticalDragEnd: (DragEndDetails details) {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
// 头部、底部控制条
|
||||||
|
Obx(
|
||||||
|
() => Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
if (widget.headerControl != null ||
|
||||||
|
_.headerControl != null) ...[
|
||||||
|
Flexible(
|
||||||
child: AppBarAni(
|
child: AppBarAni(
|
||||||
controller: animationController,
|
controller: animationController,
|
||||||
visible: !_.controlsLock.value && _.showControls.value,
|
visible: !_.controlsLock.value && _.showControls.value,
|
||||||
@ -780,13 +780,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,141 +797,141 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
/// 进度条 live模式下禁用
|
/// 进度条 live模式下禁用
|
||||||
|
|
||||||
Obx(
|
Obx(
|
||||||
() {
|
() {
|
||||||
final int value = _.sliderPositionSeconds.value;
|
final int value = _.sliderPositionSeconds.value;
|
||||||
final int max = _.durationSeconds.value;
|
final int max = _.durationSeconds.value;
|
||||||
final int buffer = _.bufferedSeconds.value;
|
final int buffer = _.bufferedSeconds.value;
|
||||||
if (_.showControls.value) {
|
if (_.showControls.value) {
|
||||||
return Container();
|
return Container();
|
||||||
}
|
}
|
||||||
if (defaultBtmProgressBehavior ==
|
if (defaultBtmProgressBehavior ==
|
||||||
BtmProgresBehavior.alwaysHide.code) {
|
BtmProgresBehavior.alwaysHide.code) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
if (defaultBtmProgressBehavior ==
|
if (defaultBtmProgressBehavior ==
|
||||||
BtmProgresBehavior.onlyShowFullScreen.code &&
|
BtmProgresBehavior.onlyShowFullScreen.code &&
|
||||||
!_.isFullScreen.value) {
|
!_.isFullScreen.value) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
} else if (defaultBtmProgressBehavior ==
|
} else if (defaultBtmProgressBehavior ==
|
||||||
BtmProgresBehavior.onlyHideFullScreen.code &&
|
BtmProgresBehavior.onlyHideFullScreen.code &&
|
||||||
_.isFullScreen.value) {
|
_.isFullScreen.value) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_.videoType == 'live') {
|
if (_.videoType == 'live') {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
if (value > max || max <= 0) {
|
if (value > max || max <= 0) {
|
||||||
return const SizedBox();
|
return const SizedBox();
|
||||||
}
|
}
|
||||||
return Positioned(
|
return Positioned(
|
||||||
bottom: -1.5,
|
bottom: -1.5,
|
||||||
left: 0,
|
left: 0,
|
||||||
right: 0,
|
right: 0,
|
||||||
child: ProgressBar(
|
child: ProgressBar(
|
||||||
progress: Duration(seconds: value),
|
progress: Duration(seconds: value),
|
||||||
buffered: Duration(seconds: buffer),
|
buffered: Duration(seconds: buffer),
|
||||||
total: Duration(seconds: max),
|
total: Duration(seconds: max),
|
||||||
progressBarColor: colorTheme,
|
progressBarColor: colorTheme,
|
||||||
baseBarColor: Colors.white.withOpacity(0.2),
|
baseBarColor: Colors.white.withOpacity(0.2),
|
||||||
bufferedBarColor: Colors.white.withOpacity(0.6),
|
bufferedBarColor: Colors.white.withOpacity(0.6),
|
||||||
timeLabelLocation: TimeLabelLocation.none,
|
timeLabelLocation: TimeLabelLocation.none,
|
||||||
thumbColor: colorTheme,
|
thumbColor: colorTheme,
|
||||||
barHeight: 3,
|
barHeight: 3,
|
||||||
thumbRadius: 0.0,
|
thumbRadius: 0.0,
|
||||||
// onDragStart: (duration) {
|
// onDragStart: (duration) {
|
||||||
// _.onChangedSliderStart();
|
// _.onChangedSliderStart();
|
||||||
// },
|
// },
|
||||||
// onDragEnd: () {
|
// onDragEnd: () {
|
||||||
// _.onChangedSliderEnd();
|
// _.onChangedSliderEnd();
|
||||||
// },
|
// },
|
||||||
// onDragUpdate: (details) {
|
// onDragUpdate: (details) {
|
||||||
// print(details);
|
// print(details);
|
||||||
// },
|
// },
|
||||||
// onSeek: (duration) {
|
// onSeek: (duration) {
|
||||||
// feedBack();
|
// feedBack();
|
||||||
// _.onChangedSlider(duration.inSeconds.toDouble());
|
// _.onChangedSlider(duration.inSeconds.toDouble());
|
||||||
// _.seekTo(duration);
|
// _.seekTo(duration);
|
||||||
// },
|
// },
|
||||||
),
|
),
|
||||||
// SlideTransition(
|
// SlideTransition(
|
||||||
// position: Tween<Offset>(
|
// position: Tween<Offset>(
|
||||||
// begin: Offset.zero,
|
// begin: Offset.zero,
|
||||||
// end: const Offset(0, -1),
|
// end: const Offset(0, -1),
|
||||||
// ).animate(CurvedAnimation(
|
// ).animate(CurvedAnimation(
|
||||||
// parent: animationController,
|
// parent: animationController,
|
||||||
// curve: Curves.easeInOut,
|
// curve: Curves.easeInOut,
|
||||||
// )),
|
// )),
|
||||||
// child: ),
|
// child: ),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
// 锁
|
// 锁
|
||||||
Obx(
|
Obx(
|
||||||
() => Visibility(
|
() => Visibility(
|
||||||
visible: _.videoType != 'live' && _.isFullScreen.value,
|
visible: _.videoType != 'live' && _.isFullScreen.value,
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: FractionalTranslation(
|
child: FractionalTranslation(
|
||||||
translation: const Offset(1, 0.0),
|
translation: const Offset(1, 0.0),
|
||||||
child: Visibility(
|
child: Visibility(
|
||||||
visible: _.showControls.value,
|
visible: _.showControls.value,
|
||||||
child: ComBtn(
|
child: ComBtn(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
_.controlsLock.value
|
_.controlsLock.value
|
||||||
? FontAwesomeIcons.lock
|
? FontAwesomeIcons.lock
|
||||||
: FontAwesomeIcons.lockOpen,
|
: FontAwesomeIcons.lockOpen,
|
||||||
size: 15,
|
size: 15,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
fuc: () => _.onLockControl(!_.controlsLock.value),
|
||||||
),
|
),
|
||||||
fuc: () => _.onLockControl(!_.controlsLock.value),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
//
|
||||||
//
|
Obx(() {
|
||||||
Obx(() {
|
if (_.dataStatus.loading || _.isBuffering.value) {
|
||||||
if (_.dataStatus.loading || _.isBuffering.value) {
|
return Center(
|
||||||
return Center(
|
child: Container(
|
||||||
child: Container(
|
padding: const EdgeInsets.all(30),
|
||||||
padding: const EdgeInsets.all(30),
|
decoration: const BoxDecoration(
|
||||||
decoration: const BoxDecoration(
|
shape: BoxShape.circle,
|
||||||
shape: BoxShape.circle,
|
gradient: RadialGradient(
|
||||||
gradient: RadialGradient(
|
colors: [Colors.black26, Colors.transparent],
|
||||||
colors: [Colors.black26, Colors.transparent],
|
),
|
||||||
|
),
|
||||||
|
child: Lottie.asset(
|
||||||
|
'assets/loading.json',
|
||||||
|
width: 200,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
child: Lottie.asset(
|
);
|
||||||
'assets/loading.json',
|
} else {
|
||||||
width: 200,
|
return const SizedBox();
|
||||||
),
|
}
|
||||||
),
|
}),
|
||||||
);
|
|
||||||
} else {
|
|
||||||
return const SizedBox();
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
|
|
||||||
/// 快进/快退面板
|
/// 快进/快退面板
|
||||||
SeekPanel(
|
SeekPanel(
|
||||||
mountSeekBackwardButton: _mountSeekBackwardButton,
|
mountSeekBackwardButton: _mountSeekBackwardButton,
|
||||||
mountSeekForwardButton: _mountSeekForwardButton,
|
mountSeekForwardButton: _mountSeekForwardButton,
|
||||||
hideSeekBackwardButton: _hideSeekBackwardButton,
|
hideSeekBackwardButton: _hideSeekBackwardButton,
|
||||||
hideSeekForwardButton: _hideSeekForwardButton,
|
hideSeekForwardButton: _hideSeekForwardButton,
|
||||||
onSubmittedcb: _handleSubmittedCallback,
|
onSubmittedcb: _handleSubmittedCallback,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user