创建map集合 (Map<int, bool> map = new Map();)
来源:5-5 Flutter之Dart常用数据类型(Map)
hardman_
2020-05-21
Map<int, bool> map = new Map(); 会报错 Failed assertion: boolean expression must not be null
写回答
3回答
-
帮你试了下,Map<int, bool> map = new Map();是可以正常运行的,语法也不存在错误,Failed assertion: boolean expression must not be null的问题是由于你往map中存的数据有null的情况,在你向map中添加数据时加个null判断,存在null数据不往map中存。
012020-05-26 -
海宁6
2020-09-11
he following assertion was thrown building KeyedSubtree-[<0>]:
Failed assertion: boolean expression must not be null
The relevant error-causing widget was:
TabBarView
这是怎么回事啊?
00 -
cat199032
2020-05-25
并没有报错
012020-05-25
相似问题
.map的含义
回答 2