I am trying to concatenate 2 fields from a firestore document. The data exists and the DropdownMenuItem populates if I use just one field. However, if I use 2 fields I get an error "Invalid arguments". How do I concatenate the 2 fields (fName and 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(),
);