The Dart ternary operator syntax (examples)
As a quick note, in the Dart programming language, the ternary operator syntax is the same as the Java ternary operator syntax. The general syntax is:
result = testCondition ? trueValue : falseValue
Dart ternary operator syntax examples
A few examples helps to demonstrate Dart’s ternary syntax: