google_maps_place_picker icon indicating copy to clipboard operation
google_maps_place_picker copied to clipboard

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

Open royhayek opened this issue 4 years ago • 3 comments

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 avatar Jan 06 '21 09:01 royhayek

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()), ), ); },

royhayek avatar Jan 07 '21 11:01 royhayek

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

lailai0715 avatar Jan 18 '21 10:01 lailai0715

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

spookymodem avatar Feb 02 '21 13:02 spookymodem