fysoul17 / google_maps_place_picker

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

selectInitialPosition: true is not working #175

Open shanu95 opened 2 years ago

shanu95 commented 2 years ago

Describe the bug When i set the selectInitialPosition: true it should show the picked place in floating card when initialy open the map, but it doesn't show. I also added initialPosition: kInitialPosition and useCurrentLocation: true. The card is only shows when i searched a placed.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. Screenshot_20220601-183933

Flutter Doctor -v

[✓] Flutter (Channel stable, 3.0.1, on macOS 12.4 21F79 darwin-arm (Rosetta), locale en-GB) • Flutter version 3.0.1 at /Users/daredevil/Developer/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision fb57da5f94 (13 days ago), 2022-05-19 15:50:29 -0700 • Engine revision caaafc5604 • Dart version 2.17.1 • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) • Android SDK at /Users/daredevil/Library/Android/sdk • Platform android-32, build-tools 32.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1) • Xcode at /Applications/Xcode.app/Contents/Developer • CocoaPods version 1.11.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.67.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.40.0

[✓] Connected device (3 available) • SM G970F (mobile) • RF8M223FMRP • android-arm64 • Android 12 (API 31) • macOS (desktop) • macos • darwin-arm64 • macOS 12.4 21F79 darwin-arm (Rosetta) • Chrome (web) • chrome • web-javascript • Google Chrome 98.0.4758.80 ! Error: Alexis’s iPhone is not connected. Xcode will continue when Alexis’s iPhone is connected. (code -13)

[✓] HTTP Host Availability • All required HTTP hosts are available

• No issues found!

Additional context This is the code i'm using

Navigator.push(
                            context,
                            MaterialPageRoute(
                              builder: (context) => PlacePicker(
                                hintText: "Enter plot location",
                                apiKey:
                                    "API KEY", // Put YOUR OWN KEY here.

                                initialPosition: kInitialPosition,
                                useCurrentLocation: true,
                                selectInitialPosition: true,
                                onPlacePicked: (result) {
                                  //print(result.address);
                                  _plotlocationController.text =
                                      result.formattedAddress!;
                                  print(result.formattedAddress);
                                  print(result.placeId);
                                  print(result.geometry!.location);
                                  print(result.types);
                                  Navigator.of(context).pop();
                                  setState(() {});
                                },
                              ),
                            ),
                          `);`