如何从DropdownButtonFormField中重置或选择第一个值?从这里How to reset value in Flutter DropdownButtonFormField的答案是过时的,不适合较新的颤动版本。DropdownButtonFormField: final etSkillScore1Key = GlobalKey<FormState>();
我使用的是用户之前选择的app.The DropdownButtonFormField gets value from firestore中的DropdownButtonFormField。问题是,当用户想要选择另一个值时,DropdownButtonFormField不会更改为新选择的值,而是显示存储的值。我尝试使用_dropdownformkey.currentState.reset()重置表单,但没有任何更改
我尝试为空的onChanged参数赋
我面临的主要问题是,即使在调用了drain()和close()之后,最终的值仍然保留在主题中。我如何重置它?这里的_title和_goalMessage总是返回最终的值,即使在调用了drain()和close()方法之后也是如此: class GoalsBloc {
final _repository =