if, else if, and else
Run code only when conditions hold.
Run Code Only Sometimes
Sometimes you want code to run only when a condition is met. The if statement is how you make that choice in Dart. 🔀
The Basic if
An if takes a bool in parentheses. When it is true, the block in braces runs; when false, Dart simply skips it.
if (score > 90) {
print("Great job!");
}