|
|
@@ -9,14 +9,18 @@ import 'package:get/get.dart';
|
|
|
|
|
|
import '../resource/colors.gen.dart';
|
|
|
|
|
|
-typedef TalkShareCallback = void Function(
|
|
|
- ShareTalkType shareType, ShareTo shareTo, String dialogTag);
|
|
|
+typedef TalkShareCallback = void Function(ShareTalkType shareType,
|
|
|
+ ShareTo shareTo, String fileName, String dialogTag);
|
|
|
|
|
|
-void showTalkShareDialog(String title, TalkShareCallback callback) {
|
|
|
+void showTalkShareDialog(String? title, TalkShareCallback callback) {
|
|
|
const String tag = 'showTalkShareDialog';
|
|
|
|
|
|
Rx<ShareTalkType> shareType = ShareTalkType.summary.obs;
|
|
|
|
|
|
+ String getFileName() {
|
|
|
+ return '${shareType.value == ShareTalkType.summary ? '[谈话总结]' : '[谈话原文]'} $title.txt';
|
|
|
+ }
|
|
|
+
|
|
|
SmartDialog.show(
|
|
|
tag: tag,
|
|
|
maskColor: Colors.black54,
|
|
|
@@ -37,12 +41,13 @@ void showTalkShareDialog(String title, TalkShareCallback callback) {
|
|
|
Assets.images.iconTalkTxt
|
|
|
.image(width: 28.w, height: 32.w),
|
|
|
SizedBox(width: 6.w),
|
|
|
- Expanded(
|
|
|
- child: Text(title,
|
|
|
- style: TextStyle(
|
|
|
- fontSize: 14.sp,
|
|
|
- fontWeight: FontWeight.bold,
|
|
|
- color: ColorName.primaryTextColor))),
|
|
|
+ Expanded(child: Obx(() {
|
|
|
+ return Text(getFileName(),
|
|
|
+ style: TextStyle(
|
|
|
+ fontSize: 14.sp,
|
|
|
+ fontWeight: FontWeight.bold,
|
|
|
+ color: ColorName.primaryTextColor));
|
|
|
+ })),
|
|
|
SizedBox(width: 18.w),
|
|
|
GestureDetector(
|
|
|
onTap: () {
|
|
|
@@ -88,11 +93,13 @@ void showTalkShareDialog(String title, TalkShareCallback callback) {
|
|
|
children: [
|
|
|
_buildShareItem(StringName.dialogSendFriend.tr,
|
|
|
Assets.images.iconWx.provider(), () {
|
|
|
- callback(shareType.value, ShareTo.wechat, tag);
|
|
|
+ callback(shareType.value, ShareTo.wechat, getFileName(),
|
|
|
+ tag);
|
|
|
}),
|
|
|
_buildShareItem(StringName.dialogSendFriend.tr,
|
|
|
Assets.images.iconQq.provider(), () {
|
|
|
- callback(shareType.value, ShareTo.qq, tag);
|
|
|
+ callback(
|
|
|
+ shareType.value, ShareTo.qq, getFileName(), tag);
|
|
|
}),
|
|
|
],
|
|
|
)
|