Flutter:父组件调用子组件的方法

418 阅读1分钟

子组件中,在类的最外面定义GlobalKey<_ChildState> globalKey = GlobalKey(); image.png 在父组件中引用子组件: image.png 在父组件中需要的位置调用子组件的方法 image.png