From 177fd261bb5086c26d4bf55c764a5ff89678501f Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Fri, 22 Jan 2021 16:34:06 -0800 Subject: [PATCH] Remove workaround now that type promotion accounts for local boolean variables. (#74449) --- packages/flutter/lib/src/widgets/scrollable.dart | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/flutter/lib/src/widgets/scrollable.dart b/packages/flutter/lib/src/widgets/scrollable.dart index 752b54b4c77..23113fc0363 100644 --- a/packages/flutter/lib/src/widgets/scrollable.dart +++ b/packages/flutter/lib/src/widgets/scrollable.dart @@ -982,16 +982,6 @@ class ScrollAction extends Action { final bool contextIsValid = focus != null && focus.context != null; if (contextIsValid) { // 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) return true; // Check for fallback scrollable with context from PrimaryScrollController