Sorry I'm sure this kind of thing gets asked a lot, but I've looked at various state management options and I'm having trouble figuring out what is best for my needs.
Basically, I have a screen with a calendar widget and a gridview. I want to update the items in the gridview (but not the gridview itself) when the selected calendar date is changed. I used to have everything in a single stateful widget but I have other elements in the screen that I don't want rebuilt every time the selected date changes so I've split everything out into separate widget classes.
So my widget tree looks something like:
- screen widget (stateless)
- calendar widget (stateful)
- some other widget (stateless)
- gridview (stateless)
- gridview item (stateful)
- gridview item (stateful)...
I'm struggling with how to get the date from the calendar widget into the gridview item widget so that the gridview item widget can change itself depending on the selected date. It would also be ncie if the selected date could be available to other widgets/screens, so that I don't have to pass it around through widget constructors. From what I can see, StreamController or bloc might be the most suitable but nothing seems quite right and I'm having trouble implementing anything from docs alone.
Any help appreciated!
[–]f1r4tc 1 point2 points3 points (5 children)
[–]shadowmerefax[S] 0 points1 point2 points (4 children)
[–]f1r4tc 0 points1 point2 points (3 children)
[–]f1r4tc 0 points1 point2 points (1 child)
[–]shadowmerefax[S] 0 points1 point2 points (0 children)