I try to hide widgets based on state variables, but all I can find are "if/else" conditional-operators like this:
actions: <Widget>[
_someBoolean ? new IconButton(
icon: new Icon(Icons.person_add),
) : new IconButton(
icon: new Icon(Icons.cancel),
),
]
What I try to achieve is to simply hide widgets based on a single "if" condition, something like this:
actions: <Widget>[
if(_someBoolean){ new IconButton(
icon: new Icon(Icons.person_add),
)},
if(_someOtherBoolean){ new IconButton(
icon: new Icon(Icons.cancel),
)},
]
Using "null" as the else-part will throw an error.
In returned widgets (that ones with "return in front"), I can use IF without problems, but that doesn't work in child widgets.
Is there any concept like this that works in child widgets?
Do I miss something in general (flutter is new to me)?
Any help or a link to some documentation would be helpful :)
Thanks a lot,
Mike