• Paul Berry's avatar
    Ignore/fix dead_code checks for weak-only null checks. (#63794) · d80aa480
    Paul Berry authored
    Now that https://github.com/dart-lang/sdk/issues/41985 is fixed, the
    analyzer detects dead code due to "unnecessary" null checks.  Since we
    want to retain null checks in Flutter even when they appear
    unnecessary (in order to preserve runtime behavior in weak mode), we
    need to suppress these dead code hints.
    
    Note that one assertion is removed by this PR (`heightFactor != null
    || (heightFactor == 1.0 && heightDelta == 0.0)`).  This is because
    `heightFactor == 1.0 && heightDelta == 0.0` can only be true if
    `heightFactor != null`, so this assertion is equivalent to simply
    asserting that `heightFactor != null`, which is already asserted two
    lines above.
    d80aa480
text_span.dart 15.5 KB