google_places_search_field 1.0.2 copy "google_places_search_field: ^1.0.2" to clipboard
google_places_search_field: ^1.0.2 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 #

Prerequisites #

  1. Enable the Places API and Maps SDK for Android/iOS in Google Cloud Console.
  2. Add your API key with the required restrictions.

Installation #

In your pubspec.yaml, add:

dependencies:
  flutter:
    sdk: flutter

  # Add the latest version
  flutter_google_places_sdk:

  # Add the latest version
  google_maps_flutter:

  # This package (use latest)
  google_places_search_field:

Preview #

Google Places Search Field Screen Shot

Platform Support #

Platform Supported
Android ✅ Yes
iOS ✅ Yes
Web ❌ No
macOS ⚠️ Untested
Windows ⚠️ Untested
Linux ⚠️ Untested

❗️ This package does not support Flutter Web due to limitations in flutter_google_places_sdk and google_maps_flutter. Consider using google_maps_webservice or a platform-channel implementation for web-specific use cases.

Usage #

GooglePlacesSearchField(
  apiKey: 'YOUR_GOOGLE_API_KEY',
  onLatLngSelected: (LatLng latLng) {
    print('Selected location: ${latLng.latitude}, ${latLng.longitude}');
  },
  hintText: 'Search for a place',
);
1
likes
160
points
33
downloads

Publisher

verified publisherpranavk.com

Weekly Downloads

A customizable Flutter widget for searching locations using Google Places Autocomplete with LatLng callback support

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_google_places_sdk, google_maps_flutter

More

Packages that depend on google_places_search_field