How to use a Ternary Operator with multiple condition in flutter dart?
If you’re referring to else if statements in dart, then this ternary operator: (foo==1)? something1():(foo==2)? something2(): something3(); is equivalent to this: if(foo == 1){ something1(); } elseif(foo == 2){ something2(); } else something3();