Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-fluwx
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
openSourceLibrary
clx-fluwx
Commits
770c57c8
提交
770c57c8
authored
10月 19, 2018
作者:
JarvanMo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
WeChatShareMiniProgramModel now uses WXMiniProgramType
上级
47c82af2
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
25 行增加
和
29 行删除
+25
-29
gradle-wrapper.properties
example/android/gradle/wrapper/gradle-wrapper.properties
+1
-1
fluwx_iml.dart
lib/src/fluwx_iml.dart
+3
-15
wechat_share_models.dart
lib/src/models/wechat_share_models.dart
+6
-13
utils.dart
lib/src/utils/utils.dart
+15
-0
没有找到文件。
example/android/gradle/wrapper/gradle-wrapper.properties
浏览文件 @
770c57c8
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.
6
-all.zip
distributionUrl
=
https
\:
//services.gradle.org/distributions/gradle-4.
10.2
-all.zip
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
zipStorePath
=
wrapper/dists
lib/src/fluwx_iml.dart
浏览文件 @
770c57c8
...
@@ -21,6 +21,7 @@ import 'models/wechat_response.dart';
...
@@ -21,6 +21,7 @@ import 'models/wechat_response.dart';
import
'models/wechat_share_models.dart'
;
import
'models/wechat_share_models.dart'
;
import
'wechat_type.dart'
;
import
'wechat_type.dart'
;
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'utils/utils.dart'
;
StreamController
<
WeChatShareResponse
>
_responseShareController
=
StreamController
<
WeChatShareResponse
>
_responseShareController
=
new
StreamController
.
broadcast
();
new
StreamController
.
broadcast
();
...
@@ -133,9 +134,9 @@ Future sendAuth({ String openId,@required String scope,String state}) async {
...
@@ -133,9 +134,9 @@ Future sendAuth({ String openId,@required String scope,String state}) async {
return
await
_channel
.
invokeMethod
(
"sendAuth"
,
{
"scope"
:
scope
,
"state"
:
state
,
"openId"
:
openId
});
return
await
_channel
.
invokeMethod
(
"sendAuth"
,
{
"scope"
:
scope
,
"state"
:
state
,
"openId"
:
openId
});
}
}
Future
launchMiniProgram
(
{
@required
String
username
,
String
path
,
WXMiniProgramType
mini
programt
ype
=
WXMiniProgramType
.
RELEASE
})
async
{
Future
launchMiniProgram
(
{
@required
String
username
,
String
path
,
WXMiniProgramType
mini
ProgramT
ype
=
WXMiniProgramType
.
RELEASE
})
async
{
assert
(
username
!=
null
&&
username
.
trim
().
isNotEmpty
);
assert
(
username
!=
null
&&
username
.
trim
().
isNotEmpty
);
return
await
_channel
.
invokeMethod
(
"launchMiniProgram"
,
{
"userName"
:
username
,
"path"
:
path
,
"miniProgramType"
:
mini
programt
ype
});
return
await
_channel
.
invokeMethod
(
"launchMiniProgram"
,
{
"userName"
:
username
,
"path"
:
path
,
"miniProgramType"
:
mini
ProgramT
ype
});
}
}
...
@@ -167,15 +168,3 @@ Future pay(
...
@@ -167,15 +168,3 @@ Future pay(
}
}
int
_miniProgramTypeToInt
(
WXMiniProgramType
type
){
switch
(
type
){
case
WXMiniProgramType
.
PREVIEW
:
return
0
;
case
WXMiniProgramType
.
TEST
:
return
1
;
case
WXMiniProgramType
.
RELEASE
:
return
2
;
}
}
\ No newline at end of file
lib/src/models/wechat_share_models.dart
浏览文件 @
770c57c8
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
import
'package:flutter/foundation.dart'
;
import
'package:flutter/foundation.dart'
;
import
'../wechat_type.dart'
;
import
'../wechat_type.dart'
;
import
'../utils/utils.dart'
;
const
String
_scene
=
"scene"
;
const
String
_scene
=
"scene"
;
const
String
_transaction
=
"transaction"
;
const
String
_transaction
=
"transaction"
;
const
String
_thumbnail
=
"thumbnail"
;
const
String
_thumbnail
=
"thumbnail"
;
...
@@ -75,21 +75,15 @@ class WeChatShareTextModel extends WeChatShareModel {
...
@@ -75,21 +75,15 @@ class WeChatShareTextModel extends WeChatShareModel {
///
///
/// [WeChatScene] is not supported here due to WeChat's limits.
/// [WeChatScene] is not supported here due to WeChat's limits.
/// [miniProgramTyp] only supports the following number:
/// [MINI_PROGRAM_TYPE_RELEASE]
/// [MINI_PROGRAM_TYPE_TEST]
/// [MINI_PROGRAM_TYPE_PREVIEW]
/// the default value is [MINI_PROGRAM_TYPE_RELEASE]
/// the default value is [MINI_PROGRAM_TYPE_RELEASE]
///
///
/// [hdImagePath] only works with iOS
/// [hdImagePath] only works with iOS
///
///
class
WeChatShareMiniProgramModel
extends
WeChatShareModel
{
class
WeChatShareMiniProgramModel
extends
WeChatShareModel
{
static
const
int
MINI_PROGRAM_TYPE_RELEASE
=
0
;
static
const
int
MINI_PROGRAM_TYPE_TEST
=
1
;
static
const
int
MINI_PROGRAM_TYPE_PREVIEW
=
2
;
final
String
webPageUrl
;
final
String
webPageUrl
;
final
int
miniProgramType
;
final
WXMiniProgramType
miniProgramType
;
final
String
userName
;
final
String
userName
;
final
String
path
;
final
String
path
;
...
@@ -108,7 +102,7 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
...
@@ -108,7 +102,7 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
///[hdImagePath] only works on iOS.
///[hdImagePath] only works on iOS.
WeChatShareMiniProgramModel
(
WeChatShareMiniProgramModel
(
{
@required
this
.
webPageUrl
,
{
@required
this
.
webPageUrl
,
int
miniProgramType
,
WXMiniProgramType
miniProgramType
,
this
.
userName
,
this
.
userName
,
this
.
path
:
"/"
,
this
.
path
:
"/"
,
this
.
title
,
this
.
title
,
...
@@ -122,11 +116,10 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
...
@@ -122,11 +116,10 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
String
messageAction
,
String
messageAction
,
String
mediaTagName
})
String
mediaTagName
})
:
this
.
transaction
=
transaction
??
"miniProgram"
,
:
this
.
transaction
=
transaction
??
"miniProgram"
,
this
.
miniProgramType
=
miniProgramType
??
MINI_PROGRAM_TYPE_
RELEASE
,
this
.
miniProgramType
=
miniProgramType
??
WXMiniProgramType
.
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
),
assert
(
miniProgramType
<
3
&&
miniProgramType
>
-
1
),
super
(
super
(
mediaTagName:
mediaTagName
,
mediaTagName:
mediaTagName
,
messageAction:
messageAction
,
messageAction:
messageAction
,
...
@@ -137,7 +130,7 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
...
@@ -137,7 +130,7 @@ class WeChatShareMiniProgramModel extends WeChatShareModel {
Map
toMap
()
{
Map
toMap
()
{
return
{
return
{
'webPageUrl'
:
webPageUrl
,
'webPageUrl'
:
webPageUrl
,
"miniProgramType"
:
miniProgramType
,
"miniProgramType"
:
miniProgramType
ToInt
(
miniProgramType
)
,
"userName"
:
userName
,
"userName"
:
userName
,
"path"
:
path
,
"path"
:
path
,
"title"
:
title
,
"title"
:
title
,
...
...
lib/src/utils/utils.dart
0 → 100644
浏览文件 @
770c57c8
import
'../wechat_type.dart'
;
int
miniProgramTypeToInt
(
WXMiniProgramType
type
){
switch
(
type
){
case
WXMiniProgramType
.
PREVIEW
:
return
2
;
case
WXMiniProgramType
.
TEST
:
return
1
;
case
WXMiniProgramType
.
RELEASE
:
return
0
;
}
return
0
;
}
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论