An if statement widget.
bool _statement = true;
Container(
child:_stament==true?GestureDetector(
child:FlatButton(onPressed: ()=>print('onPressed'), child: Text('Button'))
):Container())
)
bool _statement = true;
Container(
child:If(_statement,
child:GestureDetector(
child:FlatButton(onPressed: ()=>print('onPressed'), child: Text('Button'))
))
)
/// or
Container(
child:If(_statement,
builder:(context)=>GestureDetector(
child:FlatButton(onPressed: ()=>print('onPressed'), child: Text('Button'))
))
)