Skip to content
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

Open
fefeswa opened this issue Mar 31, 2023 · 5 comments

Comments

@fefeswa
Copy link

fefeswa commented Mar 31, 2023

same ideas please thank you

@fefeswa
Copy link
Author

fefeswa commented Apr 2, 2023

flutter_google_places_hoc081098 1.2.0

this is function perfect with my issue and is the same code

@fefeswa
Copy link
Author

fefeswa commented Apr 15, 2023

the solution is use this

https://pub.dev/packages/flutter_google_places_hoc081098

is the same code and implementation

@Camille-D
Copy link

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

@fefeswa
Copy link
Author

fefeswa commented Feb 26, 2024

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.

@fefeswa
Copy link
Author

fefeswa commented Feb 26, 2024

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

sorry but have time I publish something more check if is valid for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants