Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
bd101648
提交
bd101648
authored
10月 13, 2024
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* 分享新增基础字段:thumbData
* 分享新增基础字段:thumbDataHash
上级
282461be
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
206 行增加
和
89 行删除
+206
-89
FluwxShareHandler.kt
...ain/kotlin/com/jarvan/fluwx/handlers/FluwxShareHandler.kt
+8
-0
FluwxPlugin.m
ios/Classes/FluwxPlugin.m
+89
-6
arguments.dart
lib/src/foundation/arguments.dart
+2
-0
share_models.dart
lib/src/foundation/share_models.dart
+107
-83
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/handlers/FluwxShareHandler.kt
浏览文件 @
bd101648
...
...
@@ -261,6 +261,14 @@ internal interface FluwxShareHandler : CoroutineScope {
call
.
argument
<
String
?>(
"msgSignature"
)
?.
let
{
msg
.
msgSignature
=
it
}
call
.
argument
<
ByteArray
?>(
"thumbData"
)
?.
let
{
msg
.
thumbData
=
it
}
call
.
argument
<
String
?>(
"thumbDataHash"
)
?.
let
{
msg
.
thumbDataHash
=
it
}
msg
.
messageExt
=
call
.
argument
(
"messageExt"
)
msg
.
mediaTagName
=
call
.
argument
(
"mediaTagName"
)
msg
.
title
=
call
.
argument
(
keyTitle
)
...
...
ios/Classes/FluwxPlugin.m
浏览文件 @
bd101648
...
...
@@ -15,6 +15,8 @@ NSString *const fluwxKeyImageData = @ "imageData";
NSString
*
const
fluwxKeyThumbnail
=
@"thumbnail"
;
NSString
*
const
fluwxKeyDescription
=
@"description"
;
NSString
*
const
fluwxKeyMsgSignature
=
@"msgSignature"
;
NSString
*
const
fluwxKeyThumbData
=
@"thumbData"
;
NSString
*
const
fluwxKeyThumbDataHash
=
@"thumbDataHash"
;
NSString
*
const
fluwxKeyPackage
=
@"?package="
;
...
...
@@ -538,7 +540,13 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
}
dispatch_async
(
dispatch_get_main_queue
(),
^
{
FlutterStandardTypedData
*
flutterThumbData
=
call
.
arguments
[
fluwxKeyThumbData
];
NSData
*
thumbData
=
nil
;
if
(
flutterThumbData
!=
nil
){
thumbData
=
flutterThumbData
.
data
;
}
NSNumber
*
scene
=
call
.
arguments
[
fluwxKeyScene
];
[
self
sendImageData
:
sourceImageData
TagName
:
call
.
arguments
[
fluwxKeyMediaTagName
]
...
...
@@ -549,6 +557,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
title
:
call
.
arguments
[
fluwxKeyTitle
]
description
:
call
.
arguments
[
fluwxKeyDescription
]
MsgSignature
:
call
.
arguments
[
fluwxKeyMsgSignature
]
ThumbData
:
thumbData
ThumbDataHash
:
call
.
arguments
[
fluwxKeyThumbDataHash
]
completion
:^
(
BOOL
done
)
{
result
(
@
(
done
));
}
...
...
@@ -570,6 +580,13 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
NSString
*
webPageUrl
=
call
.
arguments
[
@"webPage"
];
NSNumber
*
scene
=
call
.
arguments
[
fluwxKeyScene
];
FlutterStandardTypedData
*
flutterThumbData
=
call
.
arguments
[
fluwxKeyThumbData
];
NSData
*
thumbData
=
nil
;
if
(
flutterThumbData
!=
nil
){
thumbData
=
flutterThumbData
.
data
;
}
[
self
sendLinkURL
:
webPageUrl
TagName
:
call
.
arguments
[
fluwxKeyMediaTagName
]
Title
:
call
.
arguments
[
fluwxKeyTitle
]
...
...
@@ -579,6 +596,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
MessageAction
:
call
.
arguments
[
fluwxKeyMessageAction
]
InScene
:
[
self
intToWeChatScene
:
scene
]
MsgSignature
:
call
.
arguments
[
fluwxKeyMsgSignature
]
ThumbData
:
thumbData
ThumbDataHash
:
call
.
arguments
[
fluwxKeyThumbDataHash
]
completion
:^
(
BOOL
done
)
{
result
(
@
(
done
));
}];
...
...
@@ -594,7 +613,13 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
UIImage
*
thumbnailImage
=
[
self
getCommonThumbnail
:
call
];
dispatch_async
(
dispatch_get_main_queue
(),
^
{
FlutterStandardTypedData
*
flutterThumbData
=
call
.
arguments
[
fluwxKeyThumbData
];
NSData
*
thumbData
=
nil
;
if
(
flutterThumbData
!=
nil
){
thumbData
=
flutterThumbData
.
data
;
}
NSNumber
*
scene
=
call
.
arguments
[
fluwxKeyScene
];
[
self
sendMusicURL
:
call
.
arguments
[
@"musicUrl"
]
dataURL
:
call
.
arguments
[
@"musicDataUrl"
]
...
...
@@ -608,6 +633,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
TagName
:
call
.
arguments
[
fluwxKeyMediaTagName
]
InScene
:
[
self
intToWeChatScene
:
scene
]
MsgSignature
:
call
.
arguments
[
fluwxKeyMsgSignature
]
ThumbData
:
thumbData
ThumbDataHash
:
call
.
arguments
[
fluwxKeyThumbDataHash
]
completion
:^
(
BOOL
done
)
{
result
(
@
(
done
));
}
...
...
@@ -625,7 +652,13 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
NSNumber
*
scene
=
call
.
arguments
[
fluwxKeyScene
];
FlutterStandardTypedData
*
flutterThumbData
=
call
.
arguments
[
fluwxKeyThumbData
];
NSData
*
thumbData
=
nil
;
if
(
flutterThumbData
!=
nil
){
thumbData
=
flutterThumbData
.
data
;
}
[
self
sendVideoURL
:
call
.
arguments
[
@"videoUrl"
]
VideoLowBandUrl
:
call
.
arguments
[
@"videoLowBandUrl"
]
Title
:
call
.
arguments
[
fluwxKeyTitle
]
...
...
@@ -636,7 +669,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
TagName
:
call
.
arguments
[
fluwxKeyMediaTagName
]
InScene
:
[
self
intToWeChatScene
:
scene
]
MsgSignature
:
call
.
arguments
[
fluwxKeyMsgSignature
]
ThumbData
:
thumbData
ThumbDataHash
:
call
.
arguments
[
fluwxKeyThumbDataHash
]
completion
:^
(
BOOL
done
)
{
result
(
@
(
done
));
}];
...
...
@@ -661,6 +695,14 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
NSNumber
*
scene
=
call
.
arguments
[
fluwxKeyScene
];
FlutterStandardTypedData
*
flutterThumbData
=
call
.
arguments
[
fluwxKeyThumbData
];
NSData
*
thumbData
=
nil
;
if
(
flutterThumbData
!=
nil
){
thumbData
=
flutterThumbData
.
data
;
}
[
self
sendFileData
:
data
fileExtension
:
fileExtension
Title
:
call
.
arguments
[
fluwxKeyTitle
]
...
...
@@ -668,7 +710,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
thumbnailImage
InScene
:
[
self
intToWeChatScene
:
scene
]
MsgSignature
:
call
.
arguments
[
fluwxKeyMsgSignature
]
ThumbData
:
thumbData
ThumbDataHash
:
call
.
arguments
[
fluwxKeyThumbDataHash
]
completion
:^
(
BOOL
success
)
{
result
(
@
(
success
));
}];
...
...
@@ -700,6 +743,13 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
dispatch_async
(
dispatch_get_main_queue
(),
^
{
FlutterStandardTypedData
*
flutterThumbData
=
call
.
arguments
[
fluwxKeyThumbData
];
NSData
*
thumbData
=
nil
;
if
(
flutterThumbData
!=
nil
){
thumbData
=
flutterThumbData
.
data
;
}
NSNumber
*
scene
=
call
.
arguments
[
fluwxKeyScene
];
NSNumber
*
typeInt
=
call
.
arguments
[
@"miniProgramType"
];
...
...
@@ -724,6 +774,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
TagName
:
call
.
arguments
[
fluwxKeyMediaTagName
]
InScene
:
[
self
intToWeChatScene
:
scene
]
MsgSignature
:
call
.
arguments
[
fluwxKeyMsgSignature
]
ThumbData
:
thumbData
ThumbDataHash
:
call
.
arguments
[
fluwxKeyThumbDataHash
]
completion
:^
(
BOOL
done
)
{
result
(
@
(
done
));
}
...
...
@@ -1145,6 +1197,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
title
:
(
NSString
*
)
title
description
:
(
NSString
*
)
description
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXImageObject
*
ext
=
[
WXImageObject
object
];
ext
.
imageData
=
imageData
;
...
...
@@ -1157,6 +1211,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
thumbImage
MediaTag
:
(
tagName
==
(
id
)
[
NSNull
null
])
?
nil
:
tagName
MsgSignature
:
(
msgSignature
==
(
id
)
[
NSNull
null
])
?
nil
:
msgSignature
ThumbData
:
thumbData
ThumbDataHash
:
(
thumbDataHash
==
(
id
)
[
NSNull
null
])
?
nil
:
thumbDataHash
];;
...
...
@@ -1177,6 +1233,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
MessageAction
:
(
NSString
*
)
messageAction
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXWebpageObject
*
ext
=
[
WXWebpageObject
object
];
ext
.
webpageUrl
=
urlString
;
...
...
@@ -1189,6 +1247,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
thumbImage
MediaTag
:
(
tagName
==
(
id
)
[
NSNull
null
])
?
nil
:
tagName
MsgSignature
:
(
msgSignature
==
(
id
)
[
NSNull
null
])
?
nil
:
msgSignature
ThumbData
:
thumbData
ThumbDataHash
:
(
thumbDataHash
==
(
id
)
[
NSNull
null
])
?
nil
:
thumbDataHash
];
SendMessageToWXReq
*
req
=
[
self
requestWithText
:
nil
...
...
@@ -1210,6 +1270,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
TagName
:
(
NSString
*
)
tagName
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXMusicObject
*
ext
=
[
WXMusicObject
object
];
...
...
@@ -1230,6 +1292,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
thumbImage
MediaTag
:
(
tagName
==
(
id
)
[
NSNull
null
])
?
nil
:
tagName
MsgSignature
:
(
msgSignature
==
(
id
)
[
NSNull
null
])
?
nil
:
msgSignature
ThumbData
:
thumbData
ThumbDataHash
:
(
thumbDataHash
==
(
id
)
[
NSNull
null
])
?
nil
:
thumbDataHash
];
SendMessageToWXReq
*
req
=
[
self
requestWithText
:
nil
...
...
@@ -1250,6 +1314,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
TagName
:
(
NSString
*
)
tagName
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXMediaMessage
*
message
=
[
WXMediaMessage
message
];
message
.
title
=
(
title
==
(
id
)
[
NSNull
null
])
?
nil
:
title
;
...
...
@@ -1278,6 +1344,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
(
UIImage
*
)
thumbImage
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXMediaMessage
*
message
=
[
WXMediaMessage
message
];
[
message
setThumbImage
:
thumbImage
];
...
...
@@ -1306,6 +1374,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
(
UIImage
*
)
thumbImage
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXMediaMessage
*
message
=
[
WXMediaMessage
message
];
message
.
title
=
title
;
...
...
@@ -1344,6 +1414,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
TagName
:
(
NSString
*
)
tagName
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXMiniProgramObject
*
ext
=
[
WXMiniProgramObject
object
];
ext
.
webpageUrl
=
(
webpageUrl
==
(
id
)
[
NSNull
null
])
?
nil
:
webpageUrl
;
...
...
@@ -1362,6 +1434,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
thumbImage
MediaTag
:
(
tagName
==
(
id
)
[
NSNull
null
])
?
nil
:
tagName
MsgSignature
:
(
msgSignature
==
(
id
)
[
NSNull
null
])
?
nil
:
msgSignature
ThumbData
:
thumbData
ThumbDataHash
:
(
thumbDataHash
==
(
id
)
[
NSNull
null
])
?
nil
:
thumbDataHash
];
...
...
@@ -1383,6 +1457,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
(
UIImage
*
)
thumbImage
InScene
:
(
enum
WXScene
)
scene
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
completion
:
(
void
(
^
__nullable
)(
BOOL
success
))
completion
{
WXAppExtendObject
*
ext
=
[
WXAppExtendObject
object
];
ext
.
extInfo
=
info
;
...
...
@@ -1397,6 +1473,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
ThumbImage
:
thumbImage
MediaTag
:
nil
MsgSignature
:
(
msgSignature
==
(
id
)
[
NSNull
null
])
?
nil
:
msgSignature
ThumbData
:
thumbData
ThumbDataHash
:
(
thumbDataHash
==
(
id
)
[
NSNull
null
])
?
nil
:
thumbDataHash
];
SendMessageToWXReq
*
req
=
[
self
requestWithText
:
nil
...
...
@@ -1584,7 +1662,10 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
MessageAction
:
(
NSString
*
)
action
ThumbImage
:
(
UIImage
*
)
thumbImage
MediaTag
:
(
NSString
*
)
tagName
MsgSignature
:
(
NSString
*
)
msgSignature
{
MsgSignature
:
(
NSString
*
)
msgSignature
ThumbData
:
(
NSData
*
)
thumbData
ThumbDataHash
:
(
NSString
*
)
thumbDataHash
{
WXMediaMessage
*
message
=
[
WXMediaMessage
message
];
message
.
title
=
title
;
message
.
description
=
description
;
...
...
@@ -1592,6 +1673,8 @@ NSObject <FlutterPluginRegistrar> *_fluwxRegistrar;
message
.
messageExt
=
messageExt
;
message
.
messageAction
=
action
;
message
.
mediaTagName
=
tagName
;
message
.
thumbData
=
thumbData
;
message
.
thumbDataHash
=
thumbDataHash
;
if
(
msgSignature
!=
nil
){
message
.
msgSignature
=
msgSignature
;
}
...
...
lib/src/foundation/arguments.dart
浏览文件 @
bd101648
...
...
@@ -17,6 +17,8 @@
* the License.
*/
import
'dart:typed_data'
;
import
'../wechat_enums.dart'
;
import
'../wechat_file.dart'
;
...
...
lib/src/foundation/share_models.dart
浏览文件 @
bd101648
...
...
@@ -29,8 +29,23 @@ const String _mediaTagName = "mediaTagName";
const
String
_messageAction
=
"messageAction"
;
const
String
_compressThumbnail
=
"compressThumbnail"
;
const
String
_msgSignature
=
"msgSignature"
;
const
String
_thumbData
=
"thumbData"
;
const
String
_thumbDataHash
=
"thumbDataHash"
;
sealed
class
WeChatShareModel
with
_Argument
{}
sealed
class
WeChatShareModel
with
_Argument
{
final
String
?
title
;
final
String
?
description
;
final
Uint8List
?
thumbData
;
final
String
?
thumbDataHash
;
final
String
?
msgSignature
;
WeChatShareModel
(
{
required
this
.
title
,
required
this
.
description
,
required
this
.
thumbData
,
required
this
.
thumbDataHash
,
required
this
.
msgSignature
});
}
/// [source] the text you want to send to WeChat
/// [scene] the target you want to send
...
...
@@ -41,20 +56,21 @@ class WeChatShareTextModel extends WeChatShareModel {
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
msgSignature
,
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
,
String
?
description
,
String
?
title
,
})
:
title
=
title
??
source
,
description
=
description
??
source
;
})
:
super
(
title:
title
??
source
,
description:
description
??
source
,
);
final
String
source
;
final
WeChatScene
scene
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
String
?
title
;
final
String
?
description
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -65,7 +81,9 @@ class WeChatShareTextModel extends WeChatShareModel {
_mediaTagName:
mediaTagName
,
_title:
title
,
_description:
description
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
...
...
@@ -73,22 +91,24 @@ class WeChatShareTextModel extends WeChatShareModel {
/// [hdImagePath] only works on iOS, not sure the relationship
/// between [thumbnail] and [hdImagePath].
class
WeChatShareMiniProgramModel
extends
WeChatShareModel
{
WeChatShareMiniProgramModel
(
{
required
this
.
webPageUrl
,
this
.
miniProgramType
=
WXMiniProgramType
.
release
,
required
this
.
userName
,
this
.
path
=
"/"
,
this
.
title
,
this
.
description
,
this
.
withShareTicket
=
false
,
required
this
.
thumbnail
,
this
.
hdImagePath
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
compressThumbnail
=
true
,
this
.
msgSignature
})
:
assert
(
webPageUrl
.
isNotEmpty
),
WeChatShareMiniProgramModel
({
required
this
.
webPageUrl
,
this
.
miniProgramType
=
WXMiniProgramType
.
release
,
required
this
.
userName
,
this
.
path
=
"/"
,
super
.
title
,
super
.
description
,
this
.
withShareTicket
=
false
,
required
this
.
thumbnail
,
this
.
hdImagePath
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
compressThumbnail
=
true
,
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
,
})
:
assert
(
webPageUrl
.
isNotEmpty
),
assert
(
userName
.
isNotEmpty
),
assert
(
path
.
isNotEmpty
);
...
...
@@ -97,15 +117,12 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
final
String
userName
;
final
String
path
;
final
WeChatImage
?
hdImagePath
;
final
String
?
title
;
final
String
?
description
;
final
WeChatImage
thumbnail
;
final
bool
withShareTicket
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
bool
compressThumbnail
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -121,7 +138,9 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
,
_compressThumbnail:
compressThumbnail
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
...
...
@@ -129,28 +148,28 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
/// [scene] the target you want to send
/// [thumbnail] the preview of your image, will be created from [scene] if null.
class
WeChatShareImageModel
extends
WeChatShareModel
{
WeChatShareImageModel
(
this
.
source
,
{
WeChatImage
?
thumbnail
,
this
.
title
,
this
.
scene
=
WeChatScene
.
session
,
this
.
description
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
compressThumbnail
=
true
,
this
.
msgSignature
})
:
thumbnail
=
thumbnail
??
source
;
WeChatShareImageModel
(
this
.
source
,
{
WeChatImage
?
thumbnail
,
super
.
title
,
this
.
scene
=
WeChatScene
.
session
,
super
.
description
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
compressThumbnail
=
true
,
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
,
})
:
thumbnail
=
thumbnail
??
source
;
final
WeChatImage
source
;
final
WeChatImage
thumbnail
;
final
String
?
title
;
final
WeChatScene
scene
;
final
String
?
description
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
bool
compressThumbnail
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -162,7 +181,9 @@ class WeChatShareImageModel extends WeChatShareModel {
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
,
_compressThumbnail:
compressThumbnail
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
...
...
@@ -172,8 +193,8 @@ class WeChatShareMusicModel extends WeChatShareModel {
WeChatShareMusicModel
(
{
this
.
musicUrl
,
this
.
musicLowBandUrl
,
this
.
title
=
""
,
this
.
description
=
""
,
super
.
title
=
""
,
super
.
description
=
""
,
this
.
musicDataUrl
,
this
.
musicLowBandDataUrl
,
this
.
thumbnail
,
...
...
@@ -182,7 +203,9 @@ class WeChatShareMusicModel extends WeChatShareModel {
this
.
messageExt
,
this
.
scene
=
WeChatScene
.
session
,
this
.
compressThumbnail
=
true
,
this
.
msgSignature
})
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
})
:
assert
(
musicUrl
!=
null
||
musicLowBandUrl
!=
null
);
final
String
?
musicUrl
;
...
...
@@ -190,14 +213,11 @@ class WeChatShareMusicModel extends WeChatShareModel {
final
String
?
musicLowBandUrl
;
final
String
?
musicLowBandDataUrl
;
final
WeChatImage
?
thumbnail
;
final
String
?
title
;
final
String
?
description
;
final
WeChatScene
scene
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
bool
compressThumbnail
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -212,39 +232,40 @@ class WeChatShareMusicModel extends WeChatShareModel {
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
,
_compressThumbnail:
compressThumbnail
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
/// if [videoUrl] and [videoLowBandUrl] are both provided,
/// only [videoUrl] will be used.
class
WeChatShareVideoModel
extends
WeChatShareModel
{
WeChatShareVideoModel
(
{
this
.
scene
=
WeChatScene
.
session
,
this
.
videoUrl
,
this
.
videoLowBandUrl
,
this
.
title
=
""
,
this
.
description
=
""
,
this
.
thumbnail
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
compressThumbnail
=
true
,
this
.
msgSignature
})
:
assert
(
videoUrl
!=
null
||
videoLowBandUrl
!=
null
),
WeChatShareVideoModel
({
this
.
scene
=
WeChatScene
.
session
,
this
.
videoUrl
,
this
.
videoLowBandUrl
,
super
.
title
=
""
,
super
.
description
=
""
,
this
.
thumbnail
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
compressThumbnail
=
true
,
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
,
})
:
assert
(
videoUrl
!=
null
||
videoLowBandUrl
!=
null
),
assert
(
thumbnail
!=
null
);
final
String
?
videoUrl
;
final
String
?
videoLowBandUrl
;
final
WeChatImage
?
thumbnail
;
final
String
?
title
;
final
String
?
description
;
final
WeChatScene
scene
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
bool
compressThumbnail
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -257,7 +278,9 @@ class WeChatShareVideoModel extends WeChatShareModel {
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
,
_compressThumbnail:
compressThumbnail
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
...
...
@@ -266,28 +289,26 @@ class WeChatShareVideoModel extends WeChatShareModel {
class
WeChatShareWebPageModel
extends
WeChatShareModel
{
WeChatShareWebPageModel
(
this
.
webPage
,
{
this
.
title
=
""
,
String
?
description
,
super
.
title
=
""
,
super
.
description
,
this
.
thumbnail
,
this
.
scene
=
WeChatScene
.
session
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
msgSignature
,
this
.
compressThumbnail
=
true
,
})
:
assert
(
webPage
.
isNotEmpty
),
description
=
description
??
webPage
;
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
,
})
:
assert
(
webPage
.
isNotEmpty
);
final
String
webPage
;
final
WeChatImage
?
thumbnail
;
final
String
title
;
final
String
description
;
final
WeChatScene
scene
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
bool
compressThumbnail
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -299,7 +320,9 @@ class WeChatShareWebPageModel extends WeChatShareModel {
_mediaTagName:
mediaTagName
,
_description:
description
,
_compressThumbnail:
compressThumbnail
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
...
...
@@ -309,27 +332,26 @@ class WeChatShareWebPageModel extends WeChatShareModel {
class
WeChatShareFileModel
extends
WeChatShareModel
{
WeChatShareFileModel
(
this
.
source
,
{
this
.
title
=
""
,
this
.
description
=
""
,
super
.
title
=
""
,
super
.
description
=
""
,
this
.
thumbnail
,
this
.
scene
=
WeChatScene
.
session
,
this
.
mediaTagName
,
this
.
messageAction
,
this
.
messageExt
,
this
.
msgSignature
,
this
.
compressThumbnail
=
true
,
super
.
msgSignature
,
super
.
thumbData
,
super
.
thumbDataHash
,
});
final
WeChatFile
source
;
final
WeChatImage
?
thumbnail
;
final
String
title
;
final
String
description
;
final
WeChatScene
scene
;
final
String
?
messageExt
;
final
String
?
messageAction
;
final
String
?
mediaTagName
;
final
bool
compressThumbnail
;
final
String
?
msgSignature
;
@override
Map
<
String
,
dynamic
>
get
arguments
=>
{
...
...
@@ -341,6 +363,8 @@ class WeChatShareFileModel extends WeChatShareModel {
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
,
_compressThumbnail:
compressThumbnail
,
_msgSignature:
msgSignature
_msgSignature:
msgSignature
,
_thumbData:
thumbData
,
_thumbDataHash:
thumbDataHash
,
};
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论