如何为下拉按钮颤动创建自定义小部件

时间:2020-02-06 12:09:56

标签: flutter dart

如何为曲线下拉创建外部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;

                    });
                },

0 个答案:

没有答案