【发布时间】:2021-08-09 03:28:58
【问题描述】:
{
"success": true,
"msg": {
"name": "xxxx",
"Id": "123",
}
}
当我从 api 收到响应时,如何解码这种格式的响应?
使用时出现错误
**
Map
map = json.decode(response.data);
**
错误:Unhandled Exception: type '_InternalLinkedHashMap<String, dynamic>' is not a subtype of type 'String'
【问题讨论】:
-
已解码,您正在尝试再次解码。
-
我的意思是自动解码
-
所以我们应该直接使用响应
-
是的,你不用担心
-
但是当我使用controller.storeDetails.toString() 时,它显示为空
标签: flutter flutter-layout flutter-test