Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-09 10:53:29 +08:00
parent e0b0a98f0f
commit c7e7b3f9c5
2 changed files with 7 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ class InteractiveViewerBoundary extends StatefulWidget {
super.key,
required this.child,
required this.boundaryWidth,
this.controller,
required this.controller,
this.onScaleChanged,
this.onLeftBoundaryHit,
this.onRightBoundaryHit,
@@ -43,7 +43,7 @@ class InteractiveViewerBoundary extends StatefulWidget {
final double boundaryWidth;
/// The [TransformationController] for the [InteractiveViewer].
final TransformationController? controller;
final TransformationController controller;
/// Called when the scale changed after an interaction ended.
final ScaleChanged? onScaleChanged;
@@ -68,7 +68,7 @@ class InteractiveViewerBoundary extends StatefulWidget {
class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
with SingleTickerProviderStateMixin {
TransformationController? _controller;
late TransformationController _controller;
double? _scale;
@@ -85,8 +85,7 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
@override
void initState() {
super.initState();
_controller = widget.controller ?? TransformationController();
_controller = widget.controller;
_animateController = AnimationController(
duration: const Duration(milliseconds: 300),
@@ -98,9 +97,7 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
@override
void dispose() {
_controller!.dispose();
_animateController.dispose();
super.dispose();
}
@@ -183,7 +180,7 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
}
void _updateBoundaryDetection() {
final double scale = _controller!.value.row0[0];
final double scale = _controller.value.row0[0];
if (_scale != scale) {
// the scale changed
@@ -196,7 +193,7 @@ class InteractiveViewerBoundaryState extends State<InteractiveViewerBoundary>
return;
}
final double xOffset = _controller!.value.row0[3];
final double xOffset = _controller.value.row0[3];
final double boundaryWidth = widget.boundaryWidth;
final double boundaryEnd = boundaryWidth * scale;
final double xPos = boundaryEnd + xOffset;

View File

@@ -825,9 +825,6 @@ class VideoDetailController extends GetxController
?.stream
.position
.listen((position) {
if (!autoPlay.value) {
return;
}
int currentPos = position.inSeconds;
if (currentPos != _lastPos) {
_lastPos = currentPos;
@@ -962,7 +959,7 @@ class VideoDetailController extends GetxController
isSeek: isSeek,
);
if (isSkip) {
if (Pref.blockToast) {
if (autoPlay.value && Pref.blockToast) {
_showBlockToast('已跳过${item.segmentType.shortTitle}片段');
}
if (_isBlock && Pref.blockTrack) {