mod: lint

mod: tweaks

opt: publish page

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-05-04 11:37:13 +08:00
parent 2cfad80214
commit caa58e9d7d
313 changed files with 2751 additions and 2789 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'dart:io';
import 'dart:math';
import 'package:PiliPlus/common/constants.dart';
import 'package:PiliPlus/common/widgets/progress_bar/audio_video_progress_bar.dart';
import 'package:PiliPlus/common/widgets/progress_bar/segment_progress_bar.dart';
import 'package:PiliPlus/http/loading_state.dart';
@@ -138,7 +139,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
}
// 双击播放、暂停
void onDoubleTapCenter() async {
Future<void> onDoubleTapCenter() async {
if (plPlayerController.videoPlayerController!.state.completed) {
await plPlayerController.videoPlayerController!.seek(Duration.zero);
plPlayerController.videoPlayerController!.play();
@@ -372,13 +373,13 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
height: 30,
alignment: Alignment.center,
child: ComBtn(
icon: plPlayerController.showDmChart.value
? Icon(
icon: plPlayerController.showDmTreandChart.value
? const Icon(
Icons.show_chart,
size: 22,
color: Colors.white,
)
: Stack(
: const Stack(
clipBehavior: Clip.none,
alignment: Alignment.center,
children: [
@@ -395,8 +396,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
],
),
onTap: () {
plPlayerController.showDmChart.value =
!plPlayerController.showDmChart.value;
plPlayerController.showDmTreandChart.value =
!plPlayerController.showDmTreandChart.value;
},
),
)),
@@ -577,9 +578,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
onTap: () {
widget.videoDetailController!.setSubtitle(0);
},
child: Text(
child: const Text(
"关闭字幕",
style: const TextStyle(color: Colors.white),
style: TextStyle(color: Colors.white),
),
),
...widget.videoDetailController!.subtitles
@@ -855,7 +856,8 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
padding: const EdgeInsets.symmetric(
horizontal: 8, vertical: 4),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6),
borderRadius:
const BorderRadius.all(Radius.circular(6)),
color: theme.colorScheme.secondaryContainer,
),
child: Text(
@@ -869,12 +871,14 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
}
} else {
if (plPlayerController.cancelSeek == true) {
plPlayerController.cancelSeek = null;
plPlayerController.hasToast = null;
plPlayerController
..cancelSeek = null
..hasToast = null;
}
}
plPlayerController.onUpdatedSliderProgress(result);
plPlayerController.onChangedSliderStart();
plPlayerController
..onUpdatedSliderProgress(result)
..onChangedSliderStart();
if (plPlayerController.showSeekPreview &&
plPlayerController.cancelSeek != true) {
try {
@@ -1099,9 +1103,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
duration: const Duration(milliseconds: 150),
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: const Color(0x88000000),
borderRadius: BorderRadius.circular(16.0),
decoration: const BoxDecoration(
color: Color(0x88000000),
borderRadius: BorderRadius.all(Radius.circular(16)),
),
height: 32.0,
width: 70.0,
@@ -1135,9 +1139,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
child: IntrinsicWidth(
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
color: const Color(0x88000000),
borderRadius: BorderRadius.circular(64.0),
decoration: const BoxDecoration(
color: Color(0x88000000),
borderRadius: BorderRadius.all(Radius.circular(64)),
),
height: 34.0,
padding: const EdgeInsets.only(left: 10, right: 10),
@@ -1189,9 +1193,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
child: Container(
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
decoration: BoxDecoration(
color: const Color(0x88000000),
borderRadius: BorderRadius.circular(64.0),
decoration: const BoxDecoration(
color: Color(0x88000000),
borderRadius: BorderRadius.all(Radius.circular(64)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
@@ -1235,9 +1239,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
child: Container(
padding:
const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
decoration: BoxDecoration(
color: const Color(0x88000000),
borderRadius: BorderRadius.circular(64.0),
decoration: const BoxDecoration(
color: Color(0x88000000),
borderRadius: BorderRadius.all(Radius.circular(64)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
@@ -1317,52 +1321,51 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
// ),
Obx(
() =>
showRestoreScaleBtn.value && plPlayerController.showControls.value
? Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 95),
child: FilledButton.tonal(
style: FilledButton.styleFrom(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
backgroundColor: theme
.colorScheme.secondaryContainer
.withOpacity(0.8),
visualDensity:
VisualDensity(horizontal: -2, vertical: -2),
padding: const EdgeInsets.all(15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
),
onPressed: () async {
showRestoreScaleBtn.value = false;
final animController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 255),
);
final anim = Matrix4Tween(
begin: transformationController.value,
end: Matrix4.identity(),
).animate(
CurveTween(curve: Curves.easeOut)
.animate(animController),
);
void listener() {
transformationController.value = anim.value;
}
animController.addListener(listener);
await animController.forward(from: 0);
animController.removeListener(listener);
animController.dispose();
},
child: Text('还原屏幕'),
() => showRestoreScaleBtn.value &&
plPlayerController.showControls.value
? Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: const EdgeInsets.only(bottom: 95),
child: FilledButton.tonal(
style: FilledButton.styleFrom(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
backgroundColor: theme.colorScheme.secondaryContainer
.withOpacity(0.8),
visualDensity: VisualDensity.compact,
padding: const EdgeInsets.all(15),
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(6)),
),
),
)
: const SizedBox.shrink(),
onPressed: () async {
showRestoreScaleBtn.value = false;
final animController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 255),
);
final anim = Matrix4Tween(
begin: transformationController.value,
end: Matrix4.identity(),
).animate(
CurveTween(curve: Curves.easeOut)
.animate(animController),
);
void listener() {
transformationController.value = anim.value;
}
animController.addListener(listener);
await animController.forward(from: 0);
animController
..removeListener(listener)
..dispose();
},
child: const Text('还原屏幕'),
),
),
)
: const SizedBox.shrink(),
),
/// 进度条 live模式下禁用
@@ -1407,7 +1410,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
alignment: Alignment.bottomCenter,
children: [
if (plPlayerController.dmTrend.isNotEmpty &&
plPlayerController.showDmChart.value)
plPlayerController.showDmTreandChart.value)
buildDmChart(theme, plPlayerController),
if (plPlayerController.viewPointList.isNotEmpty &&
plPlayerController.showVP.value)
@@ -1459,7 +1462,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
bottom: 0.75,
child: IgnorePointer(
child: CustomPaint(
size: Size(double.infinity, 3.5),
size: const Size(double.infinity, 3.5),
painter: SegmentProgressBar(
segmentColors: plPlayerController.segmentList,
),
@@ -1474,7 +1477,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
bottom: 0.75,
child: IgnorePointer(
child: CustomPaint(
size: Size(double.infinity, 3.5),
size: const Size(double.infinity, 3.5),
painter: SegmentProgressBar(
segmentColors: plPlayerController.viewPointList,
),
@@ -1517,9 +1520,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
visible: plPlayerController.showControls.value &&
(isFullScreen || plPlayerController.controlsLock.value),
child: DecoratedBox(
decoration: BoxDecoration(
color: const Color(0x45000000),
borderRadius: BorderRadius.circular(8),
decoration: const BoxDecoration(
color: Color(0x45000000),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: ComBtn(
icon: Icon(
@@ -1554,9 +1557,9 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
visible:
plPlayerController.showControls.value && isFullScreen,
child: DecoratedBox(
decoration: BoxDecoration(
color: const Color(0x45000000),
borderRadius: BorderRadius.circular(8),
decoration: const BoxDecoration(
color: Color(0x45000000),
borderRadius: BorderRadius.all(Radius.circular(8)),
),
child: ComBtn(
icon: const Icon(
@@ -1700,11 +1703,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
Duration.zero,
player.state.duration,
);
plPlayerController.seekTo(
result,
type: 'slider',
);
plPlayerController.play();
plPlayerController
..seekTo(
result,
type: 'slider',
)
..play();
},
),
),
@@ -1731,11 +1735,12 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
Duration.zero,
player.state.duration,
);
plPlayerController.seekTo(
result,
type: 'slider',
);
plPlayerController.play();
plPlayerController
..seekTo(
result,
type: 'slider',
)
..play();
},
),
),
@@ -1871,7 +1876,9 @@ Widget buildSeekPreviewWidget(PlPlayerController plPlayerController) {
padding: EdgeInsets.only(left: left),
child: UnconstrainedBox(
child: ClipRRect(
borderRadius: BorderRadius.circular(scale == 2.5 ? 6 : 10),
borderRadius: scale == 2.5
? const BorderRadius.all(Radius.circular(6))
: StyleString.mdRadius,
child: Align(
widthFactor: 0.1,
heightFactor: 0.1,