pub徽章 & 代码质量分析

This commit is contained in:
v7lin 2019-03-07 19:23:38 +08:00
parent 5c83b3f773
commit aaa7f1c475
2 changed files with 3 additions and 2 deletions

View File

@ -2,6 +2,7 @@
[![Build Status](https://cloud.drone.io/api/badges/v7lin/fake_weibo/status.svg)](https://cloud.drone.io/v7lin/fake_weibo) [![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) [![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 flutter版新浪微博SDK

View File

@ -398,9 +398,9 @@ class FakeWeibo {
}).then((HttpClientResponse response) async { }).then((HttpClientResponse response) async {
if (response.statusCode == HttpStatus.ok) { if (response.statusCode == HttpStatus.ok) {
String content = await utf8.decodeStream(response); String content = await utf8.decodeStream(response);
Map<dynamic, dynamic> map = json.decode(content); Map<dynamic, dynamic> map = json.decode(content) as Map<dynamic, dynamic>;
int errorCode = map.containsKey(FakeWeiboApiBaseResp.KEY_ERROR_CODE) int errorCode = map.containsKey(FakeWeiboApiBaseResp.KEY_ERROR_CODE)
? map[FakeWeiboApiBaseResp.KEY_ERROR_CODE] ? map[FakeWeiboApiBaseResp.KEY_ERROR_CODE] as int
: FakeWeiboApiBaseResp.ERROR_CODE_SUCCESS; : FakeWeiboApiBaseResp.ERROR_CODE_SUCCESS;
if (errorCode == FakeWeiboApiBaseResp.ERROR_CODE_SUCCESS) { if (errorCode == FakeWeiboApiBaseResp.ERROR_CODE_SUCCESS) {
return FakeWeiboApiUserResp._( return FakeWeiboApiUserResp._(