use_late_for_private_fields_and_variables

Group: style

Maturity: experimental

Dart SDK: >= 2.10.0 • (Linter v0.1.118)

Since info is static, may be stale

View all Lint Rules

Using the Linter

Use late for private members with non-nullable types that are always expected to be non-null. Thus it's clear that the field is not expected to be null and it avoids null checks.

BAD:

int? _i;
m() {
  _i!.abs();
}

GOOD:

late int _i;
m() {
  _i.abs();
}