小编hei*_*lap的帖子

Dart Map语法:putIfAbsent('FirstKey',()=> 1); 什么是: ()?

在编辑器提示中你会得到:

scores.putIfAbsent(key, () => numValue);
Run Code Online (Sandbox Code Playgroud)

我使用命令向我的地图添加单个"行":

myMap.putIfAbsent(9, () => 'Planned');
yourMap.putIfAbsent('foo', () => true);
Run Code Online (Sandbox Code Playgroud)

那么:那是什么意思?

dart

3
推荐指数
1
解决办法
924
查看次数

标签 统计

dart ×1