Fix focus bug that was breaking nested navigators

Turns out we were assuming that once the global key is gone, our
listener is unregistered. It isn't.

I'm planning on adding a test as part of my nested navigator work.
This commit is contained in:
Hixie
2015-11-17 15:52:52 -08:00
parent ba10546889
commit ad2dccf9d2

View File

@@ -192,6 +192,7 @@ class FocusState extends State<Focus> {
void _scopeRemoved(GlobalKey key) {
assert(_focusedScope == key);
GlobalKey.unregisterRemoveListener(_currentlyRegisteredScopeRemovalListenerKey, _scopeRemoved);
_currentlyRegisteredScopeRemovalListenerKey = null;
setState(() {
_focusedScope = null;