删除无用类型转换

This commit is contained in:
v7lin 2021-04-15 21:20:08 +08:00
parent 8b4643871d
commit fe8d92df92

View File

@ -129,8 +129,7 @@ class Weibo {
if (response.statusCode == HttpStatus.ok) { if (response.statusCode == HttpStatus.ok) {
final String content = await utf8.decodeStream(response); final String content = await utf8.decodeStream(response);
return WeiboUserInfoResp.fromJson( return WeiboUserInfoResp.fromJson(
(json.decode(content) as Map<dynamic, dynamic>) json.decode(content) as Map<String, dynamic>);
.cast<String, dynamic>());
} }
throw HttpException( throw HttpException(
'HttpResponse statusCode: ${response.statusCode}, reasonPhrase: ${response.reasonPhrase}.'); 'HttpResponse statusCode: ${response.statusCode}, reasonPhrase: ${response.reasonPhrase}.');