felixmccuaig / flutter-autocomplete-textfield

An autocomplete Textfield for flutter
MIT License
181 stars 131 forks source link

when i don't select a item in autoCompleteTextField (android) #42

Open breitembach opened 5 years ago

breitembach commented 5 years ago

The Screen don't Open More

Another exception was thrown: setState() called after dispose(): AutoCompleteTextFieldState<banks>#f9733(lifecycle state: defunct, not mounted

Another exception was thrown: NoSuchMethodError: The method 'clear' was called on null

I/flutter ( 1454): When the exception was thrown, this was the stack:
I/flutter ( 1454): #0      Object.noSuchMethod  (dart:core-patch/object_patch.dart:50:5)
I/flutter ( 1454): #1      new AutoCompleteTextFieldState.<anonymous closure> 
package:autocomplete_textfield/autocomplete_textfield.dart:182
I/flutter ( 1454): #2      ChangeNotifier.notifyListeners 
package:flutter/…/foundation/change_notifier.dart:206
I/flutter ( 1454): #3      FocusNode._notify 
package:flutter/…/widgets/focus_manager.dart:103
I/flutter ( 1454): #4      FocusManager._update 
package:flutter/…/widgets/focus_manager.dart:474
I/flutter ( 1454): (elided 10 frames from package dart:async)
I/flutter ( 1454):
I/flutter ( 1454): The FocusNode sending notification was:
I/flutter ( 1454):   FocusNode#eab7a(FOCUSED)
I/flutter ( 1454): ════════════════════════════════════════════════════════════════════════════════════════════════════
felixmccuaig commented 5 years ago

Not really sure what you mean here...

msalinas1088 commented 5 years ago

What I think @breitembach is trying to say is that "losing focus" event is not triggering. He is selecting the autocomplete widget that then displays the suggestions but if a suggestion isn't selected and tries to leave the page then this results in an exception.

The autocomplete tries to call setState() but the page is now disposed.