且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误:List<动态>不是Map< String,dynamic>类型的子类型.

更新时间:2022-03-12 22:29:48

API返回JSON数组而不是json对象,因此列表不是Map.

API returns JSON array not json object so that is List not Map.

即用户json是Json Array的第一个元素.

i.e. User json is first element of Json Array.

因此要获取第一个元素,请使用第一个索引. 内部获取信息更新

So to get first element use first index. Inside fetch Info update

return Users.fromJson(jsonresponse[0]);