Skip to content
Justice Tech School

Dart Booleans

bool has two values, true and false. Comparisons return bool. Dart does not treat other values as truthy, so write the comparison.

Example
void main() {
  var age = 20;
  print(age >= 18);
  print(!(age >= 18));
  print(age > 10 && age < 30);
}

Exercise

Logical not.

ok

Quiz Test

Is 1 true in Dart conditions?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.