Skip to content

Commit

Permalink
fix: 截图文件没有后缀
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Jan 5, 2025
1 parent f3df508 commit 8230258
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/plugin/pl_player/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
?.screenshot(format: 'image/png')
.then((value) {
if (value != null) {
if (!context.mounted) return;
SmartDialog.showToast('点击弹窗保存截图');
showDialog(
context: context,
Expand All @@ -1287,11 +1288,17 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
shape: const RoundedRectangleBorder(),
content: GestureDetector(
onTap: () async {
String name = DateTime.now().toString();
String name = DateTime.now()
.toString()
.replaceAll(' ', '_')
.replaceAll(':', '-')
.split('.')
.first;
final SaveResult result =
await SaverGallery.saveImage(
value,
fileName: name,
extension: 'png',
androidRelativePath: "Pictures/Screenshots",
skipIfExists: false,
);
Expand Down

0 comments on commit 8230258

Please sign in to comment.