我在打印一个文件中的内容时遇到了问题
DropdownButton
通过循环获取以下内容的API请求的结果:
[{id: 1, nome: foo}, ...]
这是它的代码。
return _response.data.map<Client>((i) => Client.fromJson(i)).toList();
[Instance of 'Client', ...]
DropdownButton<Client>(
onChanged: (client) => print(client),
items: _controller.clients
.map(
(i) => print(i),
)
.toList(),
但是
type 'List<void>' is not a subtype of type 'List<DropdownMenuItem<Client>>'