mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-31 16:18:22 +08:00
opt progress bar
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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.
|
// This is the gesture recognizer used to move the thumb.
|
||||||
_EagerHorizontalDragGestureRecognizer? _drag;
|
_EagerHorizontalDragGestureRecognizer? _drag;
|
||||||
|
|
||||||
@@ -620,6 +627,8 @@ class _RenderProgressBar extends RenderBox {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _clearLabelCache() {
|
void _clearLabelCache() {
|
||||||
|
_cachedLeftLabel?.dispose();
|
||||||
|
_cachedRightLabel?.dispose();
|
||||||
_cachedLeftLabel = null;
|
_cachedLeftLabel = null;
|
||||||
_cachedRightLabel = null;
|
_cachedRightLabel = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class BottomControl extends StatelessWidget {
|
|||||||
if (value > max || max <= 0) {
|
if (value > max || max <= 0) {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
}
|
}
|
||||||
return ProgressBar(
|
final 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),
|
||||||
@@ -109,6 +109,13 @@ class BottomControl extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
if (Utils.isDesktop) {
|
||||||
|
return MouseRegion(
|
||||||
|
cursor: SystemMouseCursors.click,
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return child;
|
||||||
}),
|
}),
|
||||||
if (controller.enableSponsorBlock &&
|
if (controller.enableSponsorBlock &&
|
||||||
videoDetailController.segmentProgressList.isNotEmpty)
|
videoDetailController.segmentProgressList.isNotEmpty)
|
||||||
|
|||||||
@@ -79,12 +79,7 @@ abstract class Utils {
|
|||||||
static Future<Rect?> get sharePositionOrigin async {
|
static Future<Rect?> get sharePositionOrigin async {
|
||||||
if (await isIpad) {
|
if (await isIpad) {
|
||||||
final size = Get.size;
|
final size = Get.size;
|
||||||
return Rect.fromLTWH(
|
return Rect.fromLTWH(0, 0, size.width, size.height / 2);
|
||||||
0,
|
|
||||||
0,
|
|
||||||
size.width,
|
|
||||||
size.height / 2,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -96,10 +91,7 @@ abstract class Utils {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await SharePlus.instance.share(
|
await SharePlus.instance.share(
|
||||||
ShareParams(
|
ShareParams(text: text, sharePositionOrigin: await sharePositionOrigin),
|
||||||
text: text,
|
|
||||||
sharePositionOrigin: await sharePositionOrigin,
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
SmartDialog.showToast(e.toString());
|
SmartDialog.showToast(e.toString());
|
||||||
|
|||||||
Reference in New Issue
Block a user