0Pricing
Dart Academy · Lesson

Null-Aware Operators: ?., ??, and !

Read and default null values safely.

Working With Maybe-Null

Nullable values need gentle handling. Dart's null-aware operators let you read and default them in one short step. ✨

The Safe-Call Operator

Use ?. to call a member only when the object is not null. If it is null, the whole expression becomes null.

String? name;
int? len = name?.length;

All lessons in this course

  1. Arrow Syntax for One-Line Functions
  2. Anonymous Functions and Closures
  3. Nullable Types and the Question Mark
  4. Null-Aware Operators: ?., ??, and !
← Back to Dart Academy