How to remove a widget from tree
dart, flutter
Solution
In flutter you don't really update a tree of widget you actually generate a new tree every time you need to change it. So you only have to change the returned value of your widget `build` function.
Problem
I want to be able to remove a widget from tree, or remove a child of a widget. I tried to use states to change a widget to null but it's returning an error. Is there a solution ? Here is the error https://gist.github.com/litekangel/e2037cf5dc4dbd9c0c0a9860ad3b0270 I finally found a solution to hide/remove a widget : I just replaced it by an empty widget (may be I will add a small animation) but I am still looking for a cleaner way to do this.