提交 6244578f authored 作者: JarvanMo's avatar JarvanMo

rm WeChatSendAuthModel

上级 fe79b05a
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fluwx</name>
<comment>Project fluwx created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
connection.project.dir=
eclipse.preferences.version=1
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>android</name>
<comment>Project android created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
connection.project.dir=
eclipse.preferences.version=1
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-10/"/>
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
<classpathentry kind="output" path="bin/default"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>app</name>
<comment>Project app created by Buildship.</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
</natures>
</projectDescription>
connection.project.dir=..
eclipse.preferences.version=1
......@@ -38,8 +38,8 @@ class _SendAuthPageState extends State<SendAuthPage> {
children: <Widget>[
OutlineButton(
onPressed: () {
fluwx.sendAuth(new fluwx.WeChatSendAuthModel(
scope: "snsapi_userinfo", state: "wechat_sdk_demo_test"))
fluwx.sendAuth(
scope: "snsapi_userinfo", state: "wechat_sdk_demo_test")
.then((data) {
});
......
......@@ -4,9 +4,8 @@
/// A open source project authorized by [OpenFlutter](https://github.com/OpenFlutter).
library fluwx;
export 'src/fluwx_class.dart';
export 'src/fluwx_iml.dart';
export 'src/models/wechat_response.dart';
export 'src/models/wechat_send_auth_model.dart';
export 'src/models/wechat_share_models.dart';
export 'src/wechat_reponse.dart';
export 'src/wechat_scene.dart';
......@@ -18,7 +18,6 @@ import 'dart:async';
import 'package:flutter/services.dart';
import 'models/wechat_response.dart';
import 'models/wechat_send_auth_model.dart';
import 'models/wechat_share_models.dart';
import 'models/wechat_launchminiprogram_model.dart';
import 'package:flutter/foundation.dart';
......@@ -127,8 +126,11 @@ Future share(WeChatShareModel model) async {
}
}
Future sendAuth(WeChatSendAuthModel model) async {
return await _channel.invokeMethod("sendAuth", model.toMap());
Future sendAuth({ String openId,@required String scope,String state}) async {
// "scope": scope, "state": state, "openId": openId
assert(scope != null && scope.isNotEmpty);
return await _channel.invokeMethod("sendAuth", {"scope": scope, "state": state, "openId": openId});
}
Future launchMiniProgram(WeChatLaunchMiniProgramModel model) async {
......
/*
* Copyright (C) 2018 The OpenFlutter Organization
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import 'package:flutter/foundation.dart';
class WeChatSendAuthModel {
final String scope;
final String state;
final String openId;
WeChatSendAuthModel({@required this.scope, this.state, this.openId})
: assert(scope != null && scope.trim().isNotEmpty);
Map toMap() {
return {"scope": scope, "state": state, "openId": openId};
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论