if else flutter code example
Example 1: conditionalstatement in widget flutter
Container(
color: Colors.white,
child: ('condition')
? Widget1(...)
: Widget2(...)
)
Example 2: if else dart example
void main() {
var num = 12;
if (num % 2==0) {
print("Even");
} else {
print("Odd");
}
}
Example 3: flutter conditional statement
condition? Text("True"): null,