I have a reactive bool. Now if that is true
I show a widget , but in case that is false
then I don’t need to show anything at all in that place.
As of now I am adding a Empty Container()
or SizedBox.shrink()
if the bool is false
. Is there any way to not adding any Widget at all?
2
Answers
If the widget is child of a parent that as several children, like a
Column
orRow
you can easily insertif
statements within the list of children. Like this for exampleIf i not misunderstanding you want to hide it without using condition you can use
Visibility
to hide your widget but for conditional widget just do like @Ivo Answer