这里最简单的解决方案是使用
GlobalKey<T>:https : //docs.flutter.io/flutter/widgets/GlobalKey-
class.html
GlobalKey<MyDropDownState>
在页面小部件中创建并将其传递给MyDropDown。- 使用你的回调键:
key.currentState.reset()
;
另外,您可以使用Flutter本身使用的控制器模式。例如
TextField具有
TextEditingController:https : //docs.flutter.io/flutter/widgets/TextEditingController-
class.html



