Let's say, I have a custom button widget and I want to set the state of it's parent using setState
. How exactly can I access the parent widget's state from my custom button? Is it even possibile?
Asked
Active
Viewed 1.8k times
14

Ian Rehwinkel
- 2,486
- 5
- 22
- 56
1 Answers
11
You can use callbacks functions to achieve this. You can refer here.
In the link
- FeedPage is similar to CustomButton(ChildWiget)
- RootPage is similar to ParentWiget

Dinesh Balasubramanian
- 20,532
- 7
- 64
- 57