【发布时间】:2021-08-06 19:13:52
【问题描述】:
我正在尝试连接 Firestore 文档中的 2 个字段。如果我只使用一个字段,则数据存在并且 DropdownMenuItem 会填充。但是,如果我使用 2 个字段,则会收到错误“无效参数”。如何连接 2 个字段(fName 和 lName)?
return new DropdownButton<String>(
hint: new Text("Select Agent"),
value: _currentAgent,
onChanged: changedDropDownAgent,
items: snapshot.data.docs
.map<DropdownMenuItem<String>>((document) {
return new DropdownMenuItem<String>(
value: document.id,
**child: new Text(document.data()['fName'] +
document.data()['lName']),**
);
}).toList(),
);
【问题讨论】:
-
你能详细说明错误吗.....