• Paul Berry's avatar
    Fix flutter in preparation for implementing Dart's "Infer non-nullability from... · 9ec1601c
    Paul Berry authored
    Fix flutter in preparation for implementing Dart's "Infer non-nullability from local boolean variables" (#72494)
    
    When https://github.com/dart-lang/language/issues/1274 (Infer
    non-nullability from local boolean variables) is implemented, flow
    analysis will detect that code like this no longer needs to perform a
    null check:
    
        final bool contextIsValid = focus != null && focus.context != null;
        ...
        if (contextIsValid) {
          ... focus! ... // Null check unnecessary
        }
    
    To avoid a build failure due to the unnecessary null check, we need to
    temporarily write it in a way that we can ignore it.  Once the feature
    is complete and rolled into flutter, I'll remove the null check
    entirely.
    9ec1601c
image_provider.dart 40.9 KB