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._(