我有the same problem with lists个,现在是Map
个.
我想做什么
The following syntax is not Dart, as in it does not compile:
map?[key] ?? otherValue
如果我的map
不是102而是103,它看起来像Günter pointed out here:
list?.elementAt(index) ?? otherValue
我在寻找的是
我知道map?[key]
不是有效的语法,因此我在搜索类似elementAt
的内容,它适用于列表和 map .
map?.valueFor(key) ?? otherValue
值为
这显然还不存在.这个问题有解决方案和值为
might be a good one as well个解决方案.