如何为曲线下拉创建外部dart文件?
这是我的屏幕下拉菜单
FutureBuilder<List<UserProfession>>(
future: _profession,
builder: (BuildContext context,
AsyncSnapshot<List<UserProfession>> snapshot){
if (!snapshot.hasData) return CircularProgressIndicator();
return DropdownButton<UserProfession>(
items: snapshot.data
.map((UserProfessionList) => DropdownMenuItem<UserProfession>(
child: Text(UserProfessionList.name),
value: UserProfessionList,
))
.toList(),
onChanged: (UserProfession value) {
setState(() {
selectedProfession = value.id;
});
},