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
- Arrow Syntax for One-Line Functions
- Anonymous Functions and Closures
- Nullable Types and the Question Mark
- Null-Aware Operators: ?., ??, and !