fluttercommunity/flutter_google_places

Exception: Null check operator used on a null value

DineshTaral opened this issue ยท 12 comments

I'm not able to search any place don't know why, getting below issue

[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: Null check operator used on a null value
#0 PlacesAutocompleteState.doSearch (package:flutter_google_places/src/flutter_google_places.dart:436:28)

Same problem

Duplicate of #164

Same issue

Also facing same issue :(

in3mo commented

You have to send all the parameters of the function:
Prediction p = await PlacesAutocomplete.show( offset: 0, radius: 1000, types: [], strictbounds: false, region: "ar", context: context, apiKey: kGoogleApiKey, mode: Mode.overlay, // Mode.fullscreen language: "es", components: [Component(Component.country, "ar")] );

Thank you @in3mo

Null safety migration is not implemented in the right way, strictbounds, components and types aren't required but they're used with Null Check operator "!" which technically means they're required and will have to pass them as a workaround for now.

You have to send all the parameters of the function:
Prediction p = await PlacesAutocomplete.show( offset: 0, radius: 1000, types: [], strictbounds: false, region: "ar", context: context, apiKey: kGoogleApiKey, mode: Mode.overlay, // Mode.fullscreen language: "es", components: [Component(Component.country, "ar")] );

Which I should use it when I want to search place all of world?

Edit:
Oh I can use
components: [ ]

Used as custom widget
image

image
Still getting it

Used as custom widget
image

image
Still getting it

Resolved this by adding the following options in constructor
image

Duplicate of #164, expect an update soon.