How to use conditional statements/ternary inside a flutter widget
问题 I need to know is it possible to use ternary/if else inside flutter widgets. I'm trying to create a buttonCreator widget which will take few parameters, one of which will be the background. I need to check whether the widget has background enabled or not. What i have is this but i have no idea how to use it in real dart code. Container buildButton(String text, bool bg){ return new Container( decoration: new BoxDecoration( border: new Border.all(color: Colors.white), if (bg != true ? color: