diff --git a/packages/flutter/lib/src/widgets/framework.dart b/packages/flutter/lib/src/widgets/framework.dart index 4443a141333..34421ae2e5e 100644 --- a/packages/flutter/lib/src/widgets/framework.dart +++ b/packages/flutter/lib/src/widgets/framework.dart @@ -3110,7 +3110,7 @@ class BuildOwner { assert(_globalKeyRegistry.containsKey(key)); duplicates ??= >{}; // Uses ordered set to produce consistent error message. - final Set elements = duplicates.putIfAbsent(key, () => LinkedHashSet()); + final Set elements = duplicates.putIfAbsent(key, () => {}); elements.add(element); elements.add(_globalKeyRegistry[key]!); }