diff --git a/lib/common/widgets/progress_bar/audio_video_progress_bar.dart b/lib/common/widgets/progress_bar/audio_video_progress_bar.dart index 72b8265e..8c5c4796 100644 --- a/lib/common/widgets/progress_bar/audio_video_progress_bar.dart +++ b/lib/common/widgets/progress_bar/audio_video_progress_bar.dart @@ -482,6 +482,13 @@ class _RenderProgressBar extends RenderBox { } } + @override + void dispose() { + _drag?.dispose(); + _clearLabelCache(); + super.dispose(); + } + // This is the gesture recognizer used to move the thumb. _EagerHorizontalDragGestureRecognizer? _drag; @@ -620,6 +627,8 @@ class _RenderProgressBar extends RenderBox { } void _clearLabelCache() { + _cachedLeftLabel?.dispose(); + _cachedRightLabel?.dispose(); _cachedLeftLabel = null; _cachedRightLabel = null; } diff --git a/lib/plugin/pl_player/widgets/bottom_control.dart b/lib/plugin/pl_player/widgets/bottom_control.dart index 0d0346e1..4547faeb 100644 --- a/lib/plugin/pl_player/widgets/bottom_control.dart +++ b/lib/plugin/pl_player/widgets/bottom_control.dart @@ -53,7 +53,7 @@ class BottomControl extends StatelessWidget { if (value > max || max <= 0) { return const SizedBox.shrink(); } - return ProgressBar( + final child = ProgressBar( progress: Duration(seconds: value), buffered: Duration(seconds: buffer), total: Duration(seconds: max), @@ -109,6 +109,13 @@ class BottomControl extends StatelessWidget { ); }, ); + if (Utils.isDesktop) { + return MouseRegion( + cursor: SystemMouseCursors.click, + child: child, + ); + } + return child; }), if (controller.enableSponsorBlock && videoDetailController.segmentProgressList.isNotEmpty) diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart index df4dd23e..4186f06d 100644 --- a/lib/utils/utils.dart +++ b/lib/utils/utils.dart @@ -79,12 +79,7 @@ abstract class Utils { static Future get sharePositionOrigin async { if (await isIpad) { final size = Get.size; - return Rect.fromLTWH( - 0, - 0, - size.width, - size.height / 2, - ); + return Rect.fromLTWH(0, 0, size.width, size.height / 2); } return null; } @@ -96,10 +91,7 @@ abstract class Utils { } try { await SharePlus.instance.share( - ShareParams( - text: text, - sharePositionOrigin: await sharePositionOrigin, - ), + ShareParams(text: text, sharePositionOrigin: await sharePositionOrigin), ); } catch (e) { SmartDialog.showToast(e.toString());