google_search_place

Pub Dev

Custom Google search places autocomplete widget for all platform.

Get started

Add dependency

You can use the command to add google_search_place as a dependency with the latest stable version:

$ dart pub add google_search_place

Or you can manually add google_search_place into the dependencies section in your pubspec.yaml:

dependencies:
  google_search_place: ^replace-with-latest-version

The latest version is: Pub The latest version including pre-releases is: Pub

Before you upgrade: Breaking changes might happen in major and minor versions of packages.
See the Migration Guide for the complete breaking changes list.

Super simple to use

import 'package:google_search_place/google_search_place.dart';

final TextEditingController _searchPlaceController = TextEditingController();
 SearchPlaceAutoCompletedTextField(
  googleAPIKey: "",
  controller: _searchPlaceController,
  itmOnTap: (Prediction prediction) {
    _searchPlaceController.text = prediction.description ?? "";

    _searchPlaceController.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description?.length ?? 0));
  },
  getPlaceDetailWithLatLng: (Prediction prediction) {
    _searchPlaceController.text = prediction.description ?? "";

    _searchPlaceController.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description?.length ?? 0));

    debugPrint("${prediction.lat} ${prediction.lng}");
  }
)
    

Customization Option

You can customize a text field input decoration and debounce time