This commit is contained in:
v7lin
2019-05-24 12:12:36 +08:00
parent 86179fa3f7
commit fe8c39de65
5 changed files with 108 additions and 9 deletions

View File

@ -39,9 +39,9 @@ class Home extends StatefulWidget {
}
class _HomeState extends State<Home> {
static const String TENCENT_APPID = '222222';
static const String _TENCENT_APPID = '222222';
Tencent _tencent = Tencent();
Tencent _tencent = Tencent()..registerApp(appId: _TENCENT_APPID);
StreamSubscription<TencentLoginResp> _login;
StreamSubscription<TencentUserInfoResp> _userInfo;
@ -52,7 +52,6 @@ class _HomeState extends State<Home> {
@override
void initState() {
super.initState();
_tencent.registerApp(appId: TENCENT_APPID);
_login = _tencent.loginResp().listen(_listenLogin);
_userInfo = _tencent.userInfoResp().listen(_listenUserInfo);
_share = _tencent.shareResp().listen(_listenShare);