google_places_search_field 1.0.0
google_places_search_field: ^1.0.0 copied to clipboard
A customizable Flutter widget for searching locations using Google Places Autocomplete with LatLng callback support
A Flutter widget that integrates with the flutter_google_places_sdk and google_maps_flutter to provide a search input field with Google Places autocomplete and LatLng callback support. Ideal for apps that need smooth location search functionality.
Features #
- Google Places autocomplete integration
- Real-time search with debouncing
- Customizable input decoration and text style
- Easy retrieval of selected location's coordinates (
LatLng) - Clean overlay UI with search suggestions
Getting started #
- Add your Google Maps API key with Places API enabled.
- Make sure the following packages are added in your
pubspec.yaml:flutter_google_places_sdkgoogle_maps_flutter
- Set up billing and permissions for the Google Maps SDK on Android/iOS.
Usage #
GooglePlacesSearchField(
apiKey: 'YOUR_GOOGLE_API_KEY',
onLatLngSelected: (LatLng latLng) {
print('Selected location: ${latLng.latitude}, ${latLng.longitude}');
},
hintText: 'Search for a place',
);