flutter_google_places icon indicating copy to clipboard operation
flutter_google_places copied to clipboard

Because flutter_google_places >=0.3.0 depends on rxdart ^0.26.0 and my proyect depends on rxdart ^0.27.7

Open fefeswa opened this issue 2 years ago • 5 comments

same ideas please thank you

fefeswa avatar Mar 31 '23 15:03 fefeswa

flutter_google_places_hoc081098 1.2.0

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

fefeswa avatar Apr 02 '23 17:04 fefeswa

the solution is use this

https://pub.dev/packages/flutter_google_places_hoc081098

is the same code and implementation

fefeswa avatar Apr 15 '23 23:04 fefeswa

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

Camille-D avatar Feb 07 '24 18:02 Camille-D

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 avatar Feb 26 '24 16:02 fefeswa

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.

fefeswa avatar Feb 26 '24 16:02 fefeswa