我尝试让用户在第一个下拉列表中选择项目的类型,然后在第二个下拉列表中从对应的可用颜色中选择。然而,当我选择了一种颜色(即白色)后,现在想要切换到另一个没有这种颜色的项目时,抛出了一个错误: "There should be exactly one item with [DropdownButton来更新值,但这个错误仍然发生。child: Text(mainItem.documentID), }).toLi
我正在从API动态更新dropdown表。当我选择一个小时时,将从API中检索相应的主题。小时5有主题A和B,而小时4只有主题B。Hour 5最初选择A作为选定的主题。
当我选择hour 4时,新的列表是从API获得的,但是我得到了"item not in dropdownbuttonitemlist error“。我知道这是因为DropDownMenuField的value属性,这就是为什么我
如何从DropdownButtonFormField中重置或选择第一个值?从这里How to reset value in Flutter DropdownButtonFormField的答案是过时的,不适合较新的颤动版本。DropdownButtonFormField: final etSkillScore1Key = GlobalKey<FormState>();
...DropdownBut
DropdownButton Value does not update even after selecting different items.如果默认值为null,则会显示错误消息,如果我传递任何默认值(非null),则它永远不会更改为其他选定的值。 将currentCategory设置为DropdownButton的默认值。return DropdownButtonHideUnderline(
c
我使用的是用户之前选择的app.The DropdownButtonFormField gets value from firestore中的DropdownButtonFormField。问题是,当用户想要选择另一个值时,DropdownButtonFormField不会更改为新选择的值,而是显示存储的值。我尝试使用_drop