小编dev*_*dam的帖子

在 Dart 中执行可选(可为空)“Function”

在某些语言(例如 Swift)中,如果您有如下所示的可选变量

var onItemPressed: ((Item) -> Void)?

// we can call this variable (function) like this
onItemPressed?(Item())
Run Code Online (Sandbox Code Playgroud)

在 Dart 语言中这相当于什么?

dart flutter

6
推荐指数
1
解决办法
982
查看次数

标签 统计

dart ×1

flutter ×1