提交 8e878a79 authored 作者: JarvanMo's avatar JarvanMo

optimize API

上级 a2d88e8b
# 4.0.0-pre.2
* `Fluwx`接口优化。合并了一些函数以优化使用体验。
# 4.0.0-pre.2
* No_pay现已合并入Fluwx
* 将一些设置移到pubspec.yaml,具体可以参看`example/pubspec.yaml`
......
......@@ -205,7 +205,7 @@ class ShareSelectorPage extends StatelessWidget {
padding: const EdgeInsets.all(8.0),
child: OutlinedButton(
onPressed: () {
fluwx.open(WeChatApp());
fluwx.open(target: WeChatApp());
},
child: const Text('Open WeChat App'),
),
......
......@@ -46,7 +46,7 @@ class _LaunchMiniProgramPageState extends State<LaunchMiniProgramPage> {
children: <Widget>[
OutlinedButton(
onPressed: () {
fluwx.launchMiniProgram(username: 'gh_d43f693ca31f');
fluwx.open(target: MiniProgram(username: 'gh_d43f693ca31f'));
},
child: const Text('Launch MiniProgrom'),
),
......
......@@ -56,6 +56,7 @@ class _PayPageState extends State<PayPage> {
debugPrint(result['timestamp']);
fluwx
.pay(
which: Payment(
appId: result['appid'].toString(),
partnerId: result['partnerid'].toString(),
prepayId: result['prepayid'].toString(),
......@@ -63,7 +64,7 @@ class _PayPageState extends State<PayPage> {
nonceStr: result['noncestr'].toString(),
timestamp: result['timestamp'],
sign: result['sign'].toString(),
)
))
.then((data) {
print('---》$data');
});
......
......@@ -39,10 +39,11 @@ class _SendAuthPageState extends State<SendAuthPage> {
OutlinedButton(
onPressed: () {
fluwx
.sendAuth(
.authBy(
which: NormalAuth(
scope: 'snsapi_userinfo',
state: 'wechat_sdk_demo_test',
)
))
.then((data) {});
},
child: const Text('send auth'),
......
......@@ -123,7 +123,8 @@ class _SignAutoDeductPageState extends State<SignAutoDeductPage> {
}
void _signAutoDeduct() {
fluwx.autoDeDuct(
fluwx.autoDeduct(
data: AutoDeduct.detail(
appId: appId.text,
mchId: mchId.text,
planId: planId.text,
......@@ -135,6 +136,6 @@ class _SignAutoDeductPageState extends State<SignAutoDeductPage> {
sign: sign.text,
timestamp: timestamp.text,
returnApp: '3',
);
));
}
}
......@@ -81,11 +81,12 @@ class _SubscribeMessagePageState extends State<SubscribeMessagePage> {
}
void _requestSubMsg() {
fluwx.subscribeMsg(
fluwx.open(
target: SubscribeMessage(
appId: appId.text,
scene: int.tryParse(scene.text) ?? 1,
templateId: templateId.text,
reserved: reserved.text,
);
));
}
}
name: fluwx
description: The capability of implementing WeChat SDKs in Flutter. With Fluwx, developers can use WeChatSDK easily, such as sharing, payment, lanuch mini program and etc.
version: 4.0.0-pre.2
version: 4.0.0-pre.3
homepage: https://github.com/OpenFlutter/fluwx
environment:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论