diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index cef84ee99c..f0d25f3994 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -138,7 +138,6 @@ abstract class GlobalKey> extends Key { const GlobalKey.constructor() : super.empty(); static final Map _registry = {}; - static final Set _removedKeys = HashSet(); static final Set _debugIllFatedElements = HashSet(); static final Map _debugReservations = {}; @@ -164,10 +163,8 @@ abstract class GlobalKey> extends Key { } return true; }()); - if (_registry[this] == element) { + if (_registry[this] == element) _registry.remove(this); - _removedKeys.add(this); - } } void _debugReserveFor(Element parent) {