Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
e0c8f572
提交
e0c8f572
authored
8月 15, 2018
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.better api 2.add some params support in android
上级
ad4db98a
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
218 行增加
和
108 行删除
+218
-108
FluwxPlugin.kt
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
+1
-2
WechatPluginKeys.java
...in/kotlin/com/jarvan/fluwx/constant/WechatPluginKeys.java
+4
-0
WeChatPluginHandler.kt
...in/kotlin/com/jarvan/fluwx/handler/WeChatPluginHandler.kt
+23
-8
main.dart
example/lib/main.dart
+8
-9
fluwx.dart
lib/fluwx.dart
+1
-1
wechat_plugin.dart
lib/src/wechat_plugin.dart
+24
-32
wechat_share_models.dart
lib/src/wechat_share_models.dart
+157
-56
没有找到文件。
android/src/main/kotlin/com/jarvan/fluwx/FluwxPlugin.kt
浏览文件 @
e0c8f572
package
com.jarvan.fluwx
package
com.jarvan.fluwx
import
android.util.Log
import
com.jarvan.fluwx.constant.CallResult
import
com.jarvan.fluwx.constant.CallResult
import
com.jarvan.fluwx.constant.WeChatPluginMethods
import
com.jarvan.fluwx.constant.WeChatPluginMethods
import
com.jarvan.fluwx.handler.WeChatPluginHandler
import
com.jarvan.fluwx.handler.WeChatPluginHandler
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
import
com.tencent.mm.opensdk.openapi.WXAPIFactory
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.MethodChannel
import
io.flutter.plugin.common.MethodChannel.MethodCallHandler
import
io.flutter.plugin.common.MethodChannel.MethodCallHandler
import
io.flutter.plugin.common.MethodChannel.Result
import
io.flutter.plugin.common.MethodChannel.Result
import
io.flutter.plugin.common.MethodCall
import
io.flutter.plugin.common.PluginRegistry.Registrar
import
io.flutter.plugin.common.PluginRegistry.Registrar
class
FluwxPlugin
(
private
var
registrar
:
Registrar
)
:
MethodCallHandler
{
class
FluwxPlugin
(
private
var
registrar
:
Registrar
)
:
MethodCallHandler
{
...
...
android/src/main/kotlin/com/jarvan/fluwx/constant/WechatPluginKeys.java
浏览文件 @
e0c8f572
...
@@ -22,4 +22,8 @@ public class WechatPluginKeys {
...
@@ -22,4 +22,8 @@ public class WechatPluginKeys {
public
static
final
String
DESCRIPTION
=
"description"
;
public
static
final
String
DESCRIPTION
=
"description"
;
public
static
final
String
PACKAGE
=
"?package="
;
public
static
final
String
PACKAGE
=
"?package="
;
public
static
final
String
MESSAGE_EXT
=
"messageExt"
;
public
static
final
String
MEDIA_TAG_NAME
=
"mediaTagName "
;
public
static
final
String
MESSAGE_ACTION
=
"messageAction"
;
}
}
android/src/main/kotlin/com/jarvan/fluwx/handler/WeChatPluginHandler.kt
浏览文件 @
e0c8f572
...
@@ -72,7 +72,13 @@ object WeChatPluginHandler {
...
@@ -72,7 +72,13 @@ object WeChatPluginHandler {
msg
.
description
=
call
.
argument
(
WechatPluginKeys
.
TEXT
)
msg
.
description
=
call
.
argument
(
WechatPluginKeys
.
TEXT
)
val
req
=
SendMessageToWX
.
Req
()
val
req
=
SendMessageToWX
.
Req
()
req
.
message
=
msg
req
.
message
=
msg
setCommonArguments
(
call
,
req
)
msg
.
description
msg
.
messageAction
=
call
.
argument
<
String
>(
WechatPluginKeys
.
MESSAGE_ACTION
)
msg
.
messageExt
=
call
.
argument
<
String
>(
WechatPluginKeys
.
MESSAGE_EXT
)
msg
.
mediaTagName
=
call
.
argument
<
String
>(
WechatPluginKeys
.
MEDIA_TAG_NAME
)
setCommonArguments
(
call
,
req
,
msg
)
wxApi
?.
sendReq
(
req
)
wxApi
?.
sendReq
(
req
)
result
.
success
(
true
)
result
.
success
(
true
)
...
@@ -99,7 +105,7 @@ object WeChatPluginHandler {
...
@@ -99,7 +105,7 @@ object WeChatPluginHandler {
val
req
=
SendMessageToWX
.
Req
()
val
req
=
SendMessageToWX
.
Req
()
setCommonArguments
(
call
,
req
)
setCommonArguments
(
call
,
req
,
msg
)
req
.
message
=
msg
req
.
message
=
msg
wxApi
?.
sendReq
(
req
)
wxApi
?.
sendReq
(
req
)
result
.
success
(
true
)
result
.
success
(
true
)
...
@@ -123,10 +129,14 @@ object WeChatPluginHandler {
...
@@ -123,10 +129,14 @@ object WeChatPluginHandler {
val
msg
=
WXMediaMessage
()
val
msg
=
WXMediaMessage
()
msg
.
mediaObject
=
imgObj
msg
.
mediaObject
=
imgObj
msg
.
thumbData
=
WeChatThumbnailUtil
.
thumbnailForCommon
(
call
.
argument
(
WechatPluginKeys
.
THUMBNAIL
),
registrar
)
msg
.
thumbData
=
WeChatThumbnailUtil
.
thumbnailForCommon
(
call
.
argument
(
WechatPluginKeys
.
THUMBNAIL
),
registrar
)
msg
.
title
=
call
.
argument
<
String
>(
WechatPluginKeys
.
TITLE
)
msg
.
description
=
call
.
argument
<
String
>(
WechatPluginKeys
.
DESCRIPTION
)
//
//
val
req
=
SendMessageToWX
.
Req
()
val
req
=
SendMessageToWX
.
Req
()
setCommonArguments
(
call
,
req
)
setCommonArguments
(
call
,
req
,
msg
)
//
req.message = msg
req
.
message
=
msg
wxApi
?.
sendReq
(
req
)
wxApi
?.
sendReq
(
req
)
result
.
success
(
true
)
result
.
success
(
true
)
...
@@ -151,7 +161,7 @@ object WeChatPluginHandler {
...
@@ -151,7 +161,7 @@ object WeChatPluginHandler {
}
}
val
req
=
SendMessageToWX
.
Req
()
val
req
=
SendMessageToWX
.
Req
()
setCommonArguments
(
call
,
req
)
setCommonArguments
(
call
,
req
,
msg
)
req
.
message
=
msg
req
.
message
=
msg
wxApi
?.
sendReq
(
req
)
wxApi
?.
sendReq
(
req
)
result
.
success
(
true
)
result
.
success
(
true
)
...
@@ -175,8 +185,9 @@ object WeChatPluginHandler {
...
@@ -175,8 +185,9 @@ object WeChatPluginHandler {
msg
.
thumbData
=
WeChatThumbnailUtil
.
thumbnailForCommon
(
thumbnail
,
registrar
)
msg
.
thumbData
=
WeChatThumbnailUtil
.
thumbnailForCommon
(
thumbnail
,
registrar
)
}
}
val
req
=
SendMessageToWX
.
Req
()
val
req
=
SendMessageToWX
.
Req
()
setCommonArguments
(
call
,
req
)
setCommonArguments
(
call
,
req
,
msg
)
req
.
message
=
msg
req
.
message
=
msg
wxApi
?.
sendReq
(
req
)
wxApi
?.
sendReq
(
req
)
result
.
success
(
true
)
result
.
success
(
true
)
...
@@ -197,7 +208,7 @@ object WeChatPluginHandler {
...
@@ -197,7 +208,7 @@ object WeChatPluginHandler {
}
}
val
req
=
SendMessageToWX
.
Req
()
val
req
=
SendMessageToWX
.
Req
()
setCommonArguments
(
call
,
req
)
setCommonArguments
(
call
,
req
,
msg
)
req
.
message
=
msg
req
.
message
=
msg
wxApi
?.
sendReq
(
req
)
wxApi
?.
sendReq
(
req
)
result
.
success
(
true
)
result
.
success
(
true
)
...
@@ -242,7 +253,11 @@ object WeChatPluginHandler {
...
@@ -242,7 +253,11 @@ object WeChatPluginHandler {
else
->
SendMessageToWX
.
Req
.
WXSceneTimeline
else
->
SendMessageToWX
.
Req
.
WXSceneTimeline
}
}
private
fun
setCommonArguments
(
call
:
MethodCall
,
req
:
SendMessageToWX
.
Req
)
{
private
fun
setCommonArguments
(
call
:
MethodCall
,
req
:
SendMessageToWX
.
Req
,
msg
:
WXMediaMessage
)
{
msg
.
messageAction
=
call
.
argument
<
String
>(
WechatPluginKeys
.
MESSAGE_ACTION
)
msg
.
messageExt
=
call
.
argument
<
String
>(
WechatPluginKeys
.
MESSAGE_EXT
)
msg
.
mediaTagName
=
call
.
argument
<
String
>(
WechatPluginKeys
.
MEDIA_TAG_NAME
)
req
.
transaction
=
call
.
argument
(
WechatPluginKeys
.
TRANSACTION
)
req
.
transaction
=
call
.
argument
(
WechatPluginKeys
.
TRANSACTION
)
req
.
scene
=
getScene
(
call
.
argument
(
WechatPluginKeys
.
SCENE
))
req
.
scene
=
getScene
(
call
.
argument
(
WechatPluginKeys
.
SCENE
))
}
}
...
...
example/lib/main.dart
浏览文件 @
e0c8f572
...
@@ -18,12 +18,11 @@ class _MyAppState extends State<MyApp> {
...
@@ -18,12 +18,11 @@ class _MyAppState extends State<MyApp> {
void
initState
()
{
void
initState
()
{
super
.
initState
();
super
.
initState
();
// initPlatformState();
// initPlatformState();
Fluwx
.
init
(
"wxd930ea5d5a258f4f"
).
then
((
_
){
Fluwx
.
init
(
"wxd930ea5d5a258f4f"
).
then
((
_
)
{
print
(
"succes"
);
print
(
"succes"
);
},
onError:
(
value
)
{
},
onError:
(
value
)
{
print
(
"--->
$value
"
);
print
(
"--->
$value
"
);
});
});
}
}
// Platform messages are asynchronous, so we initialize in an async method.
// Platform messages are asynchronous, so we initialize in an async method.
...
@@ -54,15 +53,15 @@ class _MyAppState extends State<MyApp> {
...
@@ -54,15 +53,15 @@ class _MyAppState extends State<MyApp> {
title:
const
Text
(
'Plugin example app'
),
title:
const
Text
(
'Plugin example app'
),
),
),
body:
new
Center
(
body:
new
Center
(
child:
child:
new
FlatButton
(
new
FlatButton
(
onPressed:
()
{
onPressed:
()
{
var
fluwx
=
Fluwx
();
var
fluwx
=
Fluwx
();
fluwx
.
shareText
(
WeChatShareTextModel
(
text:
"share text from flutter"
,
transaction:
"hehe"
));
fluwx
.
share
(
WeChatShareTextModel
(
},
child:
new
Text
(
"share text to wechat"
)),
text:
"share text from flutter"
,
transaction:
"hehe"
));
},
child:
new
Text
(
"share text to wechat"
)),
),
),
),
),
);
);
}
}
}
}
lib/fluwx.dart
浏览文件 @
e0c8f572
library
fluw
e
;
library
fluw
x
;
export
'src/wechat_plugin.dart'
;
export
'src/wechat_plugin.dart'
;
export
'src/wechat_share_models.dart'
;
export
'src/wechat_share_models.dart'
;
export
'src/wechat_scene.dart'
;
export
'src/wechat_scene.dart'
;
...
...
lib/src/wechat_plugin.dart
浏览文件 @
e0c8f572
...
@@ -4,53 +4,45 @@ import 'package:flutter/services.dart';
...
@@ -4,53 +4,45 @@ import 'package:flutter/services.dart';
import
'package:fluwx/src/wechat_share_models.dart'
;
import
'package:fluwx/src/wechat_share_models.dart'
;
class
Fluwx
{
class
Fluwx
{
static
const
Map
<
Type
,
String
>
_shareModelMethodMapper
=
{
WeChatShareTextModel:
"shareText"
,
WeChatShareImageModel:
"shareImage"
,
WeChatShareMusicModel:
"shareMusic"
,
WeChatShareVideoModel:
"shareVideo"
,
WeChatShareWebPageModel:
"shareWebPage"
,
WeChatShareMiniProgramModel:
"shareMiniProgram"
};
static
const
MethodChannel
_channel
=
const
MethodChannel
(
'fluwx'
);
static
const
MethodChannel
_channel
=
const
MethodChannel
(
'fluwx'
);
StreamController
<
Map
>
_responseStreamController
=
new
StreamController
.
broadcast
();
StreamController
<
Map
>
_responseStreamController
=
Stream
<
Map
>
get
weChatResponseUpdate
=>
_responseStreamController
.
stream
;
new
StreamController
.
broadcast
();
Stream
<
Map
>
get
weChatResponseUpdate
=>
_responseStreamController
.
stream
;
static
Future
init
(
String
appId
)
async
{
static
Future
init
(
String
appId
)
async
{
return
await
_channel
.
invokeMethod
(
"initWeChat"
,
appId
);
return
await
_channel
.
invokeMethod
(
"initWeChat"
,
appId
);
}
}
void
listen
()
{
void
listen
()
{
_channel
.
setMethodCallHandler
(
_handler
);
_channel
.
setMethodCallHandler
(
_handler
);
}
}
void
dispose
()
{
void
dispose
()
{
_responseStreamController
.
close
();
_responseStreamController
.
close
();
}
}
Future
share
(
WeChatShareModel
model
)
async
{
if
(
_shareModelMethodMapper
.
containsKey
(
model
.
runtimeType
))
{
Future
shareText
(
WeChatShareTextModel
model
)
async
{
return
await
_channel
.
invokeMethod
(
await
_channel
.
invokeMethod
(
"shareText"
,
model
.
toMap
());
_shareModelMethodMapper
[
model
.
runtimeType
],
model
.
toMap
());
}
}
else
{
return
Future
.
error
(
"no method mapper found[
${model.runtimeType}
]"
);
Future
shareMiniProgram
(
WeChatShareMiniProgramModel
model
)
async
{
return
await
_channel
.
invokeMethod
(
"shareMiniProgram"
,
model
.
toMap
());
}
}
Future
shareMusic
(
WeChatShareMusicModel
model
)
async
{
return
await
_channel
.
invokeMethod
(
"shareMusic"
,
model
.
toMap
());
}
}
Future
shareVideo
(
WeChatShareVideoModel
model
)
async
{
Future
<
dynamic
>
_handler
(
MethodCall
methodCall
)
{
return
await
_channel
.
invokeMethod
(
"shareVideo"
,
model
.
toMap
());
if
(
"onWeChatResponse"
==
methodCall
.
method
)
{
}
Future
shareWebPage
(
WeChatShareWebPageModel
model
)
async
{
return
await
_channel
.
invokeMethod
(
"shareWebPage"
,
model
.
toMap
());
}
Future
<
dynamic
>
_handler
(
MethodCall
methodCall
){
if
(
"onWeChatResponse"
==
methodCall
.
method
){
_responseStreamController
.
add
(
methodCall
.
arguments
);
_responseStreamController
.
add
(
methodCall
.
arguments
);
}
}
...
...
lib/src/wechat_share_models.dart
浏览文件 @
e0c8f572
...
@@ -4,31 +4,63 @@ const String _scene = "scene";
...
@@ -4,31 +4,63 @@ const String _scene = "scene";
const
String
_transaction
=
"transaction"
;
const
String
_transaction
=
"transaction"
;
const
String
_thumbnail
=
"thumbnail"
;
const
String
_thumbnail
=
"thumbnail"
;
const
String
_title
=
"title"
;
const
String
_title
=
"title"
;
const
String
_description
=
"description"
;
const
String
_description
=
"description"
;
const
String
_messageExt
=
"messageExt"
;
const
String
_mediaTagName
=
"mediaTagName "
;
const
String
_messageAction
=
"messageAction"
;
abstract
class
WeChatShareModel
{
final
String
messageExt
;
final
String
messageAction
;
final
String
mediaTagName
;
final
WeChatScene
scene
;
WeChatShareModel
(
{
this
.
messageExt
,
this
.
messageAction
,
this
.
mediaTagName
,
this
.
scene
:
WeChatScene
.
SESSION
});
Map
toMap
();
}
class
WeChatShareTextModel
{
class
WeChatShareTextModel
extends
WeChatShareModel
{
final
String
text
;
final
String
text
;
final
String
transaction
;
final
String
transaction
;
final
WeChatScene
scene
;
WeChatShareTextModel
({
String
text
,
String
transaction
,
WeChatScene
scene
})
WeChatShareTextModel
(
{
String
text
,
String
transaction
,
WeChatScene
scene
,
String
messageExt
,
String
messageAction
,
String
mediaTagName
})
:
this
.
text
=
text
??
""
,
:
this
.
text
=
text
??
""
,
this
.
transaction
=
transaction
??
"text"
,
this
.
transaction
=
transaction
??
"text"
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
;
super
(
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageExt:
messageExt
,
scene:
scene
);
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
"text"
:
text
,
_transaction:
transaction
,
_scene:
scene
.
toString
()};
return
{
"text"
:
text
,
_transaction:
transaction
,
_scene:
scene
.
toString
(),
_messageExt:
messageExt
,
_messageAction:
messageAction
,
_mediaTagName:
mediaTagName
};
}
}
}
}
class
WeChatShareMiniProgramModel
{
class
WeChatShareMiniProgramModel
extends
WeChatShareModel
{
static
const
int
MINI_PROGRAM_TYPE_RELEASE
=
0
;
static
const
int
MINI_PROGRAM_TYPE_RELEASE
=
0
;
static
const
int
MINI_PROGRAM_TYPE_TEST
=
1
;
static
const
int
MINI_PROGRAM_TYPE_TEST
=
1
;
static
const
int
MINI_PROGRAM_TYPE_PREVIEW
=
2
;
static
const
int
MINI_PROGRAM_TYPE_PREVIEW
=
2
;
final
WeChatScene
scene
=
WeChatScene
.
SESSION
;
final
String
webPageUrl
;
final
String
webPageUrl
;
final
int
miniProgramType
;
final
int
miniProgramType
;
final
String
userName
;
final
String
userName
;
...
@@ -50,13 +82,23 @@ class WeChatShareMiniProgramModel {
...
@@ -50,13 +82,23 @@ class WeChatShareMiniProgramModel {
this
.
title
,
this
.
title
,
this
.
description
,
this
.
description
,
this
.
thumbnail
,
this
.
thumbnail
,
String
transaction
})
String
transaction
,
WeChatScene
scene
,
String
messageExt
,
String
messageAction
,
String
mediaTagName
})
:
this
.
transaction
=
transaction
??
"miniProgram"
,
:
this
.
transaction
=
transaction
??
"miniProgram"
,
this
.
miniProgramType
=
miniProgramType
??
MINI_PROGRAM_TYPE_RELEASE
,
this
.
miniProgramType
=
miniProgramType
??
MINI_PROGRAM_TYPE_RELEASE
,
assert
(
webPageUrl
!=
null
&&
webPageUrl
.
isNotEmpty
),
assert
(
webPageUrl
!=
null
&&
webPageUrl
.
isNotEmpty
),
assert
(
userName
!=
null
&&
userName
.
isNotEmpty
),
assert
(
userName
!=
null
&&
userName
.
isNotEmpty
),
assert
(
path
!=
null
&&
path
.
isNotEmpty
);
assert
(
path
!=
null
&&
path
.
isNotEmpty
),
super
(
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageExt:
messageExt
,
scene:
scene
);
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
return
{
'webPageUrl'
:
webPageUrl
,
'webPageUrl'
:
webPageUrl
,
...
@@ -72,31 +114,51 @@ class WeChatShareMiniProgramModel {
...
@@ -72,31 +114,51 @@ class WeChatShareMiniProgramModel {
}
}
}
}
class
WeChatShareImageModel
{
class
WeChatShareImageModel
extends
WeChatShareModel
{
final
String
transaction
;
final
String
transaction
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
image
;
final
String
image
;
final
String
thumbnail
;
final
String
thumbnail
;
final
String
title
;
final
String
description
;
WeChatShareImageModel
(
WeChatShareImageModel
(
{
String
transaction
,
WeChatScene
scene
,
this
.
image
,
String
thumbnail
})
{
String
transaction
,
this
.
image
,
this
.
description
,
String
thumbnail
,
WeChatScene
scene
,
String
messageExt
,
String
messageAction
,
String
mediaTagName
,
this
.
title
})
:
this
.
transaction
=
transaction
??
"text"
,
:
this
.
transaction
=
transaction
??
"text"
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
thumbnail
=
thumbnail
??
""
,
this
.
thumbnail
=
thumbnail
??
""
,
assert
(
image
!=
null
);
assert
(
image
!=
null
),
super
(
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageExt:
messageExt
,
scene:
scene
);
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
return
{
_transaction:
transaction
,
_transaction:
transaction
,
_scene:
scene
.
toString
(),
_scene:
scene
.
toString
(),
"image"
:
image
,
"image"
:
image
,
_thumbnail:
thumbnail
_thumbnail:
thumbnail
,
_mediaTagName:
mediaTagName
,
_messageAction:
messageAction
,
_messageExt:
messageExt
,
_title:
title
,
_description:
description
};
};
}
}
}
}
class
WeChatShareMusicModel
extends
WeChatShareModel
{
class
WeChatShareMusicModel
{
final
String
transaction
;
final
String
transaction
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
musicUrl
;
final
String
musicUrl
;
...
@@ -105,35 +167,46 @@ class WeChatShareMusicModel {
...
@@ -105,35 +167,46 @@ class WeChatShareMusicModel {
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
WeChatShareMusicModel
(
WeChatShareMusicModel
({
{
String
transaction
,
String
transaction
,
WeChatScene
scene
,
this
.
musicUrl
,
this
.
musicUrl
,
this
.
musicLowBandUrl
,
this
.
musicLowBandUrl
,
this
.
title
:
""
,
this
.
title
:
""
,
this
.
description
:
""
,
this
.
description
:
""
,
String
thumbnail
})
String
thumbnail
,
:
this
.
transaction
=
transaction
??
"text"
,
WeChatScene
scene
,
String
messageExt
,
String
messageAction
,
String
mediaTagName
,
})
:
this
.
transaction
=
transaction
??
"text"
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
thumbnail
=
thumbnail
??
""
,
this
.
thumbnail
=
thumbnail
??
""
,
assert
(
musicUrl
!=
null
||
musicLowBandUrl
!=
null
),
assert
(
musicUrl
!=
null
||
musicLowBandUrl
!=
null
),
assert
(
thumbnail
!=
null
);
assert
(
thumbnail
!=
null
),
super
(
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageExt:
messageExt
,
scene:
scene
);
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
return
{
_transaction:
transaction
,
_transaction:
transaction
,
_scene:
scene
.
toString
(),
_scene:
scene
.
toString
(),
"musicUrl"
:
musicUrl
,
"musicUrl"
:
musicUrl
,
"musicLowBandUrl"
:
musicLowBandUrl
,
"musicLowBandUrl"
:
musicLowBandUrl
,
_thumbnail:
thumbnail
,
_thumbnail:
thumbnail
,
_title:
title
,
_title:
title
,
_description:
description
,
_description:
description
,
_mediaTagName:
mediaTagName
,
_messageAction:
messageAction
,
_messageExt:
messageExt
,
};
};
}
}
}
}
class
WeChatShareVideoModel
extends
WeChatShareModel
{
class
WeChatShareVideoModel
{
final
String
transaction
;
final
String
transaction
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
videoUrl
;
final
String
videoUrl
;
...
@@ -142,34 +215,50 @@ class WeChatShareVideoModel {
...
@@ -142,34 +215,50 @@ class WeChatShareVideoModel {
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
WeChatShareVideoModel
(
final
String
messageExt
;
{
String
transaction
,
final
String
messageAction
;
final
String
mediaTagName
;
WeChatShareVideoModel
({
String
transaction
,
WeChatScene
scene
,
WeChatScene
scene
,
this
.
videoUrl
,
this
.
videoUrl
,
this
.
videoLowBandUrl
,
this
.
videoLowBandUrl
,
this
.
title
:
""
,
this
.
title
:
""
,
this
.
description
:
""
,
this
.
description
:
""
,
String
thumbnail
})
String
thumbnail
,
:
this
.
transaction
=
transaction
??
"text"
,
this
.
messageExt
,
this
.
messageAction
,
this
.
mediaTagName
,
})
:
this
.
transaction
=
transaction
??
"text"
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
thumbnail
=
thumbnail
??
""
,
this
.
thumbnail
=
thumbnail
??
""
,
assert
(
videoUrl
!=
null
||
videoLowBandUrl
!=
null
),
assert
(
videoUrl
!=
null
||
videoLowBandUrl
!=
null
),
assert
(
thumbnail
!=
null
);
assert
(
thumbnail
!=
null
),
super
(
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageExt:
messageExt
,
scene:
scene
);
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
return
{
_transaction:
transaction
,
_transaction:
transaction
,
_scene:
scene
.
toString
(),
_scene:
scene
.
toString
(),
"videoUrl"
:
videoUrl
,
"videoUrl"
:
videoUrl
,
"videoLowBandUrl"
:
videoLowBandUrl
,
"videoLowBandUrl"
:
videoLowBandUrl
,
_thumbnail:
thumbnail
,
_thumbnail:
thumbnail
,
_title:
title
,
_title:
title
,
_description:
description
_description:
description
,
_mediaTagName:
mediaTagName
,
_messageAction:
messageAction
,
_messageExt:
messageExt
,
};
};
}
}
}
}
class
WeChatShareWebPageModel
{
class
WeChatShareWebPageModel
extends
WeChatShareModel
{
final
String
transaction
;
final
String
transaction
;
final
WeChatScene
scene
;
final
WeChatScene
scene
;
final
String
webPage
;
final
String
webPage
;
...
@@ -177,27 +266,39 @@ class WeChatShareWebPageModel {
...
@@ -177,27 +266,39 @@ class WeChatShareWebPageModel {
final
String
title
;
final
String
title
;
final
String
description
;
final
String
description
;
WeChatShareWebPageModel
(
WeChatShareWebPageModel
({
{
String
transaction
,
String
transaction
,
WeChatScene
scene
,
this
.
webPage
,
this
.
webPage
,
this
.
title
:
""
,
this
.
title
:
""
,
this
.
description
:
""
,
this
.
description
:
""
,
String
thumbnail
})
String
thumbnail
,
:
this
.
transaction
=
transaction
??
"text"
,
WeChatScene
scene
,
String
messageExt
,
String
messageAction
,
String
mediaTagName
,
})
:
this
.
transaction
=
transaction
??
"text"
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
scene
=
scene
??
WeChatScene
.
TIMELINE
,
this
.
thumbnail
=
thumbnail
??
""
,
this
.
thumbnail
=
thumbnail
??
""
,
assert
(
webPage
!=
null
),
assert
(
webPage
!=
null
),
assert
(
thumbnail
!=
null
);
assert
(
thumbnail
!=
null
),
super
(
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageExt:
messageExt
,
scene:
scene
);
@override
Map
toMap
()
{
Map
toMap
()
{
return
{
return
{
_transaction:
transaction
,
_transaction:
transaction
,
_scene:
scene
.
toString
(),
_scene:
scene
.
toString
(),
"webPage"
:
webPage
,
"webPage"
:
webPage
,
_thumbnail:
thumbnail
,
_thumbnail:
thumbnail
,
_title:
title
,
_title:
title
,
_description:
description
_description:
description
,
_mediaTagName:
mediaTagName
,
_messageAction:
messageAction
,
_messageExt:
messageExt
,
};
};
}
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论