mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: share dialog
This commit is contained in:
@@ -363,31 +363,46 @@ class VideoIntroController extends GetxController {
|
|||||||
builder: (context) {
|
builder: (context) {
|
||||||
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
title: const Text('请选择'),
|
clipBehavior: Clip.hardEdge,
|
||||||
actions: [
|
contentPadding: const EdgeInsets.symmetric(vertical: 12),
|
||||||
TextButton(
|
content: Column(
|
||||||
onPressed: () {
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
title: const Text(
|
||||||
|
'复制链接',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
Clipboard.setData(ClipboardData(text: videoUrl));
|
Clipboard.setData(ClipboardData(text: videoUrl));
|
||||||
SmartDialog.showToast('已复制');
|
SmartDialog.showToast('已复制');
|
||||||
Get.back();
|
Get.back();
|
||||||
},
|
},
|
||||||
child: const Text('复制链接')),
|
),
|
||||||
TextButton(
|
ListTile(
|
||||||
onPressed: () {
|
title: const Text(
|
||||||
|
'其它app打开',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
launchUrl(Uri.parse(videoUrl));
|
launchUrl(Uri.parse(videoUrl));
|
||||||
},
|
|
||||||
child: const Text('其它app打开')),
|
|
||||||
TextButton(
|
|
||||||
onPressed: () async {
|
|
||||||
var result = await Share.share('${videoDetail.value.title} '
|
|
||||||
'UP主: ${videoDetail.value.owner!.name!}'
|
|
||||||
' - $videoUrl')
|
|
||||||
.whenComplete(() {});
|
|
||||||
Get.back();
|
Get.back();
|
||||||
return result;
|
|
||||||
},
|
},
|
||||||
child: const Text('分享视频')),
|
),
|
||||||
],
|
ListTile(
|
||||||
|
title: const Text(
|
||||||
|
'分享视频',
|
||||||
|
style: TextStyle(fontSize: 14),
|
||||||
|
),
|
||||||
|
onTap: () async {
|
||||||
|
await Share.share('${videoDetail.value.title} '
|
||||||
|
'UP主: ${videoDetail.value.owner!.name!}'
|
||||||
|
' - $videoUrl');
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user