Check out example codes for "conditionalstatement in widget flutter". It will help you in understanding the concepts better.

Code Example 1

condition? Text("True"): null,

Code Example 2

Container(
  color: Colors.white,
  child: ('condition')
  ? Widget1(...)
  : Widget2(...)
)

Learn ReactJs, React Native from akashmittal.com