Shrutimahajan / Google-AutoComplete-TextField-Flutter

MIT License
29 stars 106 forks source link

The predictions in new version [2.0.2] is not as accurate as the version [1.0.5] #3

Closed subinsv closed 3 years ago

subinsv commented 3 years ago

Hi, Thanks for this wonderful plugin.

We recently migrated the google_places_flutter plugin from version 1.0.5 to 2.0.2 and the accuracy of predication has been degraded.

Screenshot from 1.0.5

expected

Screenshot from 2.0.2

current

The screenshot from 1.0.5 seems to return proper address when searched. Is there some search algorithm changed. Is there a way to get back the previous implementation.

Shrutimahajan commented 3 years ago

I will check and update you ASAP.

On Sat, 10 Oct 2020, 12:54 am subin sv, notifications@github.com wrote:

Hi, Thanks for this wonderful plugin.

We recently migrated the google_places_flutter plugin from version 1.0.5 to 2.0.2 and the accuracy of predication has been degraded.

Screenshot from 1.0.5 [image: expected] https://user-images.githubusercontent.com/26520063/95623328-b1d59680-0a92-11eb-9b0e-ba583e6f4664.png

Screenshot from 2.0.2 [image: current] https://user-images.githubusercontent.com/26520063/95623356-bef28580-0a92-11eb-812d-d3bf1525d37a.png

The screenshot from 1.0.5 seems to return proper address when searched. Is there some search algorithm changed. Is there a way to get back the previous implementation.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Shrutimahajan/Google-AutoComplete-TextField-Flutter/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACLLRWFJMYHHB5UZAHGQVVLSJ5PNRANCNFSM4SKOKE7Q .

Shrutimahajan commented 3 years ago

@subinsv Please comment // countries: ["in", "fr"], You will get the same result as of the previous implementation.

subinsv commented 3 years ago

Thanks @Shrutimahajan

But we are not calling countries in our code. This is the code we use. No changes made during update to 2.0.2. Same code works for 1.0.5 without any issues.

GooglePlaceAutoCompleteTextField(
                textEditingController: _controller,
                googleAPIKey: AppStrings.GOOGLE_PLACE_API_KEY,
                debounceTime: 800,
                itmClick: (Prediction prediction) {
                  _controller.text = prediction.description;
                  _controller.selection = TextSelection.fromPosition(
                    TextPosition(
                      offset: prediction.description.length,
                    ),
                  );
                  //other logic here
                },
              ),
subinsv commented 3 years ago

I think I found the issue. In this commit the URL parameters are changed https://github.com/Shrutimahajan/Google-AutoComplete-TextField-Flutter/commit/b13dda6266b7079b0de32b4f68694cddde088603

The URL parameters that is added -> &types=establishment&radius=500 This causes different json response. If this is removed, I get the previous results. Is this change intentional?

Shrutimahajan commented 3 years ago

@subinsv It's an unintentional change. I will check. and release a new version.

shruti-techindustan commented 3 years ago

@subinsv Thanks for finding the issue. I will remove the "type" key as currently, it returns only business results.

subinsv commented 3 years ago

Thanks @Shrutimahajan :)

subinsv commented 3 years ago

Thanks @Shrutimahajan

The latest version is working as expected. I will close this issue