更新答案以包含@lrn的评论
您可以使用
map
const optionsMap = { 111:"First option", 222:"Second option",} return SimpleDialog( title: Text('Choose one'), children: optionsMap.entries.map((entry) { var w = Text(entry.value); doSomething(entry.key); return w; }).toList());;


