fysoul17 / google_maps_place_picker

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

After pressing on a location, the circular progress indicator isn't stopping #94

Open royhayek opened 3 years ago

royhayek commented 3 years ago

When I choose a location the circular progress indication is showing at the bottom and it never ends loading, but when I search for the same location again it works.

royhayek commented 3 years ago

I was able to fix it by making a custom selected place widget and checking wether the selectedPlace is empty instead of the state.

selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { return isSearchBarFocused ? Container() // Use FloatingCard or just create your own Widget. : FloatingCard( bottomPosition: 40.0, // MediaQuery.of(context) will cause rebuild. See MediaQuery document for the information. leftPosition: 10.0, rightPosition: 10.0, width: 500, elevation: 5, borderRadius: BorderRadius.circular(12.0), child: Padding( padding: EdgeInsets.only(top: 10, bottom: 10), child: selectedPlace != null ? Column( children: [ Text( selectedPlace.formattedAddress, style: TextStyle(fontSize: 18), ), SizedBox(height: 10), RaisedButton( child: Text('Select'), onPressed: () { print('do something here'); }, ), ], ) : Center(child: CircularProgressIndicator()), ), ); },

lailai0715 commented 3 years ago

Faced the same problem here, fixed with your provided solution. Thank you so much!

spookymodem commented 3 years ago

@royhayek This worked for me as well. Thank you!