Flutter type ‘List<dynamic>‘ is not a subtype of type ‘Map<String, dynamic>‘
请求接口获得数据进行赋值时,提示数据类型不匹配:
type 'List<dynamic>' is not a subtype of type 'Map<String, dynamic>'
检查报错代码段以及后端返回来的数据类型,
bankCardInfo = data; //错误代码
解决办法:data是后端返回来的数据,发现该数据类型是数组,使用data中的第一个元素进行赋值。
bankCardInfo = data[0];
总结:在进行请求数据时需要特别注意数据的类型以及参数,类型以及参数不匹配都会产生错误。
Flutter type ‘List<dynamic>‘ is not a subtype of type ‘Map<String, dynamic>‘相关推荐
- TypeError: super(type, obj): obj must be an instance or subtype of type这个问题怎么处理?
TypeError: super(type, obj): obj must be an instance or subtype of type这个问题怎么处理? 这个错误通常发生在使用super()函 ...
- Python提示 TypeError: super(type, obj): obj must be an instance or subtype of type问题
Python提示 TypeError: super(type, obj): obj must be an instance or subtype of type问题 简述问题 在工作中有一天将debu ...
- TypeError: super(type, obj): obj must be an instance or subtype of type
问题 今天学习<Python Web 开发实战>自定义转换器这一小节,书中有段代码如下: class ListConverter(BaseConverter):def __init__(s ...
- TypeError: super(type, obj): obj must be an instance or subtype of type 该错误的一次处理
我在写maya类的时候遇到,版本python2.7 folder lib mayaclass.py base类 A(base)类 ui.py 其中A继承base ui.py文件中内容 #python2 ...
- I/flutter ( 7317): type ‘_Map<String, dynamic>‘ is not a subtype of type ‘Folder‘
记录一个bug,再记录一下自己的新"发现". 在flutter里面将后端获取的数据转换成本地模型的时候,在模型里面使用了其他模型类型(比如外键这种) 数据结构如下(JSON): { ...
- type ‘_Map<String, dynamic>‘ is not a subtype of type ‘Map<String, Object>‘
type '_Map<String, dynamic>' is not a subtype of type 'Map<String, Object>' 使用Map<Str ...
- Flutter type ‘Future<bool>‘ is not a subtype of type ‘bool‘ in type cast
这个问题是我在使用flutter shared_preferences的时候,自己默认写了几个存储和读取的字段函数,然后出错了 问题在! 我使用的时候非常耿直 如图 getUserNameInput函 ...
- 成功解决TypeError: super(type, obj): obj must be an instance or subtype of type
super(Graphnet, self).init()改为 super().init()
- Python报错 TypeError: super(type, obj): obj must be an instance or subtype of type
今天在Spyder里用BeautifulSoup的时候跑代码报这个TypeError. 遇到这个问题之后在网上搜了一下也不知道怎么解决,结果在Spyder里重启Ipython内核之后,就没有报错能顺利 ...
- Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E>
1 java 报错如下 Type safety: The method add(Object) belongs to the raw type List. References to generic ...
最新文章
- 程序是什么--过滤器和状态机
- 微软或允许 Android 应用运行于 Windows 和 WP
- 某小公司 RESTful、共用接口、前后端分离、接口约定的实践
- 谷歌Fuchsia OS负责人离职,网友:被鸿蒙挖走了?
- 一封电子邮件的发送和接收的主要步骤
- 40. Combination Sum II 组合总和 II
- 【学习笔记】整体二分
- 神经网络基本原理简明教程之非线性回归
- html5翻牌小游戏源码,html5记忆翻牌游戏实现思路及代码
- 网站被ddos攻击了怎么办?网站正在被ddos攻击怎么解决
- 达梦DM单机部署以及日常运维管理
- Web前端性能优化——如何提高页面加载速度
- 字母易位词(anagram)
- (八)高德地图之添加marker标记点
- 菜鸟仓库-货物格子问题编程题
- Python-各种Loss总结
- 黑马——C语言的一些基础(2)
- Chrome和Firebox快捷键
- Python定时获取外网IP地址并发送邮件
- Python爬取手机APP
热门文章
- 【正点原子STM32连载】第五十二章 FPU测试(Julia分形)实验摘自【正点原子】MiniPro STM32H750 开发指南_V1.1
- 安装的Mac Windows双系统,Mac分区的空间太小/太大了,有什么办法调整吗?
- html5搜狗浏览器缓存文件夹,搜狗浏览器中怎么查找之前看过的视频文件?
- Markdown - Markdown 引用图片太大怎么办 md控制图片的大小 对齐方式
- 【服务器数据恢复】服务器raid5磁盘阵列分区丢失的数据恢复案例
- 《多多自走棋》、《全民超神》均停服:盘点那些凉得最快的游戏
- SAP《MM学习指南》操作记录----仓库盘点
- 阿拉伯数字金钱转中文大写
- 《CSS 揭秘》每章详细读书笔记
- 微信小程序canvas2D全新API介绍