Null Aware operator

Null Aware operator

What is Null aware operator?

Null-aware operators in dart allow you to make computations based on whether or not a value is null. It’s shorthand for longer expressions. A null-aware operator is a nice tool for making nullable types usable in Dart instead of throwing an error.

void main() {
  String? str = null;
  print(str?.length);
  // str = null;
  // print(str.length);
}