Unverified Commit 177fd261 authored by Paul Berry's avatar Paul Berry Committed by GitHub

Remove workaround now that type promotion accounts for local boolean variables. (#74449)

parent 0b3162bd
...@@ -982,16 +982,6 @@ class ScrollAction extends Action<ScrollIntent> { ...@@ -982,16 +982,6 @@ class ScrollAction extends Action<ScrollIntent> {
final bool contextIsValid = focus != null && focus.context != null; final bool contextIsValid = focus != null && focus.context != null;
if (contextIsValid) { if (contextIsValid) {
// Check for primary scrollable within the current context // Check for primary scrollable within the current context
// After https://github.com/dart-lang/language/issues/1274 is implemented,
// `focus` will be promoted to non-nullable so we won't need to null check
// it (and it will cause a build failure to try to do so). Until then, we
// need to null check it in a way that won't cause a build failure once
// the feature is implemented. We can do that using an explicit "if"
// test.
// TODO(paulberry): remove this hack once the feature is implemented.
if (focus == null) { // ignore: dead_code
throw 'This throw is unreachable';
}
if (Scrollable.of(focus.context!) != null) if (Scrollable.of(focus.context!) != null)
return true; return true;
// Check for fallback scrollable with context from PrimaryScrollController // Check for fallback scrollable with context from PrimaryScrollController
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment