From aaa7f1c475d149901b9ac00c4bb66f29052774db Mon Sep 17 00:00:00 2001 From: v7lin Date: Thu, 7 Mar 2019 19:23:38 +0800 Subject: [PATCH] =?UTF-8?q?pub=E5=BE=BD=E7=AB=A0=20&=20=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E8=B4=A8=E9=87=8F=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + lib/fake_weibo.dart | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4101d7f..f8dc09b 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build Status](https://cloud.drone.io/api/badges/v7lin/fake_weibo/status.svg)](https://cloud.drone.io/v7lin/fake_weibo) [![GitHub tag](https://img.shields.io/github/tag/v7lin/fake_weibo.svg)](https://github.com/v7lin/fake_weibo/releases) +[![pub package](https://img.shields.io/pub/v/fake_weibo.svg)](https://pub.dartlang.org/packages/fake_weibo) flutter版新浪微博SDK diff --git a/lib/fake_weibo.dart b/lib/fake_weibo.dart index eda5095..fad4273 100644 --- a/lib/fake_weibo.dart +++ b/lib/fake_weibo.dart @@ -398,9 +398,9 @@ class FakeWeibo { }).then((HttpClientResponse response) async { if (response.statusCode == HttpStatus.ok) { String content = await utf8.decodeStream(response); - Map map = json.decode(content); + Map map = json.decode(content) as Map; int errorCode = map.containsKey(FakeWeiboApiBaseResp.KEY_ERROR_CODE) - ? map[FakeWeiboApiBaseResp.KEY_ERROR_CODE] + ? map[FakeWeiboApiBaseResp.KEY_ERROR_CODE] as int : FakeWeiboApiBaseResp.ERROR_CODE_SUCCESS; if (errorCode == FakeWeiboApiBaseResp.ERROR_CODE_SUCCESS) { return FakeWeiboApiUserResp._(