Im new to flutter, I see I can't use if statement with curly braces but what if I have the below code, do I have to repeat if statement in every widget?
Block1
if(product.length>0)
Container(..)
if(product.length>0)
Divider(..),
block2
else
Container(...)
Expanded(..)
so I can't use curly here but what is the solution for this issue?
Use the ...[ block to display multiple widgets conditionally
if(product.length>0) ...[
Container(..),
Container(..)
] else ...[
const SizedBox(),
Container(..),
]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With