opt: pm share

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-28 12:11:20 +08:00
parent 7f93b42a1b
commit aed45b08ac
6 changed files with 36 additions and 27 deletions

View File

@@ -630,18 +630,21 @@ class _ArticlePageState extends State<ArticlePage>
return;
}
}
PageUtils.pmShare(
content: {
"id": _articleCtr.commentId,
"title": "- 哔哩哔哩专栏",
"headline": _articleCtr.summary.title!, // throw
"source": 6,
"thumb": _articleCtr.summary.cover!,
"author": _articleCtr.summary.author!.name,
"author_id":
_articleCtr.summary.author!.mid.toString(),
},
);
if (mounted) {
PageUtils.pmShare(
this.context,
content: {
"id": _articleCtr.commentId,
"title": "- 哔哩哔哩专栏",
"headline": _articleCtr.summary.title!, // throw
"source": 6,
"thumb": _articleCtr.summary.cover!,
"author": _articleCtr.summary.author!.name,
"author_id":
_articleCtr.summary.author!.mid.toString(),
},
);
}
} catch (e) {
SmartDialog.showToast(e.toString());
}

View File

@@ -256,7 +256,7 @@ class BangumiIntroController
Future actionShareVideo(context) async {
showDialog(
context: context,
builder: (context) {
builder: (_) {
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
return AlertDialog(
clipBehavior: Clip.hardEdge,
@@ -351,6 +351,7 @@ class BangumiIntroController
.firstWhere((item) => item.epId == epId);
final title = '${bangumiItem!.title!} ${item.showTitle}';
PageUtils.pmShare(
context,
content: {
"id": epId!.toString(),
"title": title,

View File

@@ -240,10 +240,10 @@ class AuthorPanel extends StatelessWidget {
constraints: BoxConstraints(
maxWidth: min(640, min(Get.width, Get.height)),
),
builder: (context) {
builder: (context1) {
return Padding(
padding:
EdgeInsets.only(bottom: MediaQuery.of(context).padding.bottom),
EdgeInsets.only(bottom: MediaQuery.of(context1).padding.bottom),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
@@ -338,6 +338,7 @@ class AuthorPanel extends StatelessWidget {
: item.modules.moduleDynamic!.major!.opus!.pics!.first
.url!;
PageUtils.pmShare(
context,
content: {
"id": id,
"title": title,

View File

@@ -454,6 +454,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
onTap: () {
try {
PageUtils.pmShare(
this.context,
content: {
"cover": _liveRoomController
.roomInfoH5.value.roomInfo!.cover!,

View File

@@ -435,7 +435,7 @@ class VideoIntroController extends GetxController {
Future actionShareVideo(context) async {
showDialog(
context: context,
builder: (context) {
builder: (_) {
String videoUrl = '${HttpString.baseUrl}/video/$bvid';
return AlertDialog(
clipBehavior: Clip.hardEdge,
@@ -510,6 +510,7 @@ class VideoIntroController extends GetxController {
Get.back();
try {
PageUtils.pmShare(
context,
content: {
"id": videoDetail.value.aid!.toString(),
"title": videoDetail.value.title!,

View File

@@ -28,7 +28,7 @@ import 'package:get/get.dart';
import 'package:url_launcher/url_launcher.dart';
class PageUtils {
static void pmShare({required Map content}) async {
static void pmShare(BuildContext context, {required Map content}) async {
// debugPrint(content.toString());
List<UserModel> userList = <UserModel>[];
@@ -54,16 +54,18 @@ class PageUtils {
}
}
showModalBottomSheet(
context: Get.context!,
builder: (context) => SharePanel(
content: content,
userList: userList,
),
useSafeArea: true,
enableDrag: false,
isScrollControlled: true,
);
if (context.mounted) {
showModalBottomSheet(
context: context,
builder: (context) => SharePanel(
content: content,
userList: userList,
),
useSafeArea: true,
enableDrag: false,
isScrollControlled: true,
);
}
}
static void scheduleExit(BuildContext context, isFullScreen,