Ternary operator in Dart

Ternary Conditional Operators are a pretty useful thing in Dart. They can be used to conditionally show a Flutter widget. They accept 2 operands. If the given condition is true, the first thing will be executed and if it is false, it will execute the second one. Example in Dart code. void main() { bool isComplete = false; print(isComplete ? "completed!" : "not Completed"); } //Outputs not Completed This will print not completed....

March 15, 2021 · 3 min · Muhammed Mukhthar CM