From a00cfa6b3e9b1ed9ccceb3fc9fa9c3135b363785 Mon Sep 17 00:00:00 2001 From: v7lin Date: Thu, 11 Jul 2019 21:43:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/weibo.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/weibo.dart b/lib/src/weibo.dart index 19ee5b2..6544df0 100644 --- a/lib/src/weibo.dart +++ b/lib/src/weibo.dart @@ -10,6 +10,10 @@ import 'package:flutter/services.dart'; import 'package:meta/meta.dart'; class Weibo { + Weibo() { + _channel.setMethodCallHandler(_handleMethod); + } + static const String _METHOD_REGISTERAPP = 'registerApp'; static const String _METHOD_ISWEIBOINSTALLED = 'isWeiboInstalled'; static const String _METHOD_AUTH = 'auth'; @@ -53,7 +57,6 @@ class Weibo { }) { assert(appKey != null && appKey.isNotEmpty); assert(scope != null && scope.isNotEmpty); - _channel.setMethodCallHandler(_handleMethod); return _channel.invokeMethod( _METHOD_REGISTERAPP, {