fysoul17 / google_maps_place_picker

Place picker on Google Maps for Flutter
MIT License
222 stars 357 forks source link

Autocomplete place does not show keyboard to allow type #77

Open giaur500 opened 3 years ago

giaur500 commented 3 years ago

Please any advice? I am not sure what caused that: I compiled your example and it works. I did the same in my app and picker works, but I am unable to type anything in search bar. If I paste text, autocomplete works. But I am unable to type anything, as keyboard never shows up. My code:

class HomePageState extends State<HomePage> {

  PickResult _selectedPlace;

 @override
  Widget build(BuildContext context) {

    var _fabMiniMenuItemList = [
      new FabMiniMenuItem.withText(
          new Icon(Icons.error),
          Colors.blue,
          4.0,
          "Button menu", () => _createLocationPicker(),
          Strings.menu_new_problem,
          Colors.blue,
          Colors.white,
          true),
      new FabMiniMenuItem.withText(
          new Icon(Icons.lightbulb_outline),
          Colors.blue,
          4.0,
          "Button menu", () => _createLocationPicker(),
          Strings.menu_new_suggestion,
          Colors.blue,
          Colors.white,
          true),
    ];

To show location picker:

_createLocationPicker () {
    Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => PlacePicker(
          apiKey: "AIzaSyCxggeDq3er0BzOIWYvhHrhlyduYfomgPM",
          onPlacePicked: (result) {
            print(result.formattedAddress);
            setState(() => _selectedPlace = result);
            Navigator.of(context).pop();
          },
          initialPosition: HomePage.kInitialPosition,
          useCurrentLocation: true,
          selectInitialPosition: true,
          hintText: "Search",
          //usePinPointingSearch: false
        ),
      ),
    );
  }

There is nothing special in my HomePage definition. Any ideas what could cause this problem? The same api key for maps, the same place picker plugin version, the same target api (AndroidX).