Controlling State from outside of a StatefulWidget

前端 未结 7 1008
耶瑟儿~
耶瑟儿~ 2020-11-29 18:44

I\'m trying to understand the best practice for controlling a StatefulWidget\'s state outside of that Widgets State.

I have the following interface defined.

<
相关标签:
7条回答
  • 2020-11-29 19:29

    Have you considered lifting the state to the parent widget? It is a common, though less ideal than Redux, way to manage state in React as far as I know, and this repository shows how to apply the concept to a Flutter app.

    0 讨论(0)
提交回复
热议问题