google_maps_place_picker
google_maps_place_picker copied to clipboard
After pressing on a location, the circular progress indicator isn't stopping
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.
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()), ), ); },
Faced the same problem here, fixed with your provided solution. Thank you so much!
@royhayek This worked for me as well. Thank you!