-
Notifications
You must be signed in to change notification settings - Fork 430
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Because flutter_google_places >=0.3.0 depends on rxdart ^0.26.0 and my proyect depends on rxdart ^0.27.7 #223
Comments
flutter_google_places_hoc081098 1.2.0 this is function perfect with my issue and is the same code |
the solution is use this https://pub.dev/packages/flutter_google_places_hoc081098 is the same code and implementation |
Hi, I have the same problem. There are pending pull requests to correct the issue. When will this pull request be accepted? the latest version of the package seems a long way away, is this repository still maintained? @juliansteenbakker |
In flutter_google_places.dart main class it add listener in initState() Timer? _debounce; @OverRide void initState() { super.initState(); _queryTextController!.addListener(_onQueryChange); // added listener } in the listener it initialized the _debounce. void _onQueryChange() { if (_debounce?.isActive ?? false) _debounce!.cancel(); _debounce = Timer(Duration(milliseconds: widget.debounce), () { if (!_queryBehavior.isClosed) { _queryBehavior.add(_queryTextController!.text); } }); } in dispose method it cancels the _debounce with ! operator . @OverRide void dispose() { super.dispose(); _debounce!.cancel(); } So when we back button pressed without entering text add listener not called and _debounce is not initialized and on dispose we cancel the debounce with ! operator which throws the error because it is not initialized. So change the _debounce!.cancel() to _debounce?.cancel() will solve the error. I'm having the same issue, and manually changing _debounce!.cancel() to _debounce?.cancel() worked for me too. Would be great to have this included in a release. |
sorry but have time I publish something more check if is valid for you. |
same ideas please thank you
The text was updated successfully, but these errors were encountered: