From 8b4643871d5fd4511f551fe48241f6edde6af49c Mon Sep 17 00:00:00 2001 From: Stellar Date: Thu, 15 Apr 2021 21:17:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DiOS=E5=B9=B3=E5=8F=B0channel?= =?UTF-8?q?=E4=BC=A0=E9=80=92=E7=9A=84=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=20(#29)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix bug: _CastError (type '_InternalLinkedHashMap' is not a subtype of type 'Map' in type cast) * fix _CastError (type '_InternalLinkedHashMap' is not a subtype of type 'Map' in type cast) --- lib/src/weibo.dart | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/src/weibo.dart b/lib/src/weibo.dart index 94863b6..8074ed7 100644 --- a/lib/src/weibo.dart +++ b/lib/src/weibo.dart @@ -71,12 +71,12 @@ class Weibo { Future _handleMethod(MethodCall call) async { switch (call.method) { case _METHOD_ONAUTHRESP: - _authRespStreamController.add( - WeiboAuthResp.fromJson(call.arguments as Map)); + _authRespStreamController.add(WeiboAuthResp.fromJson( + (call.arguments as Map).cast())); break; case _METHOD_ONSHAREMSGRESP: - _shareMsgRespStreamController - .add(WeiboSdkResp.fromJson(call.arguments as Map)); + _shareMsgRespStreamController.add(WeiboSdkResp.fromJson( + (call.arguments as Map).cast())); break; } } @@ -129,7 +129,8 @@ class Weibo { if (response.statusCode == HttpStatus.ok) { final String content = await utf8.decodeStream(response); return WeiboUserInfoResp.fromJson( - json.decode(content) as Map); + (json.decode(content) as Map) + .cast()); } throw HttpException( 'HttpResponse statusCode: ${response.statusCode}, reasonPhrase: ${response.reasonPhrase}.');