패키지, 저장소 및 앱 카테고리 검색

GitHub 저장소julienandco/google_places_autocomplete_text_field

google_places_autocomplete_text_field

julienandco/google_places_autocomplete_text_field open-source repository details.

google_places_autocomplete_text_field 프로젝트 이미지
스타
10
포크
41
최근 푸시(UTC)
2026. 9. 7.
프로젝트 상태
활성

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

google_places_autocomplete_text_field

This Flutter package helps you build a TextField that provides autocompletion suggestions from the new Google Places API.

Go check it out on pub.dev!

Add the dependency to pubspec.yml ➕

dependencies:
  flutter:
    sdk: flutter
  google_places_autocomplete_text_field: <last-version>

Integrate the Google AutoComplete TextField Widget in your code 🧩

    GooglePlacesAutoCompleteTextFormField(
        textEditingController: controller,
        config: const GoogleApiConfig(
          apiKey: 'YOUR_GOOGLE_API_KEY',
          // only needed if you build for the web
          proxyURL: 'https://your-proxy.com/',
          countries: ['de'], // optional, by default the list is empty (no restrictions)
          fetchPlaceDetailsWithCoordinates: true,  // if you require the coordinates from the place details
          debounceTime: 400, // defaults to 600 ms
          locationRestriction: LocationConfig.circle(
            circleCenter: const Coordinates(latitude: 52.5200, longitude: 13.4050),
            circleRadiusInKilometers: 1000,
          ), // either this or locationBias (or nothing)
          placeTypeRestriction: PlaceType.city, // if you want specific place types
        ),
        onPredictionWithCoordinatesReceived: (prediction) {
         // this method will return latlng with place detail
        print("Coordinates: (${prediction.lat},${prediction.lng})");
        // the place details are returned on the prediction as well
        print("Address: ${prediction.formattedAddress}");
        print("Components: ${prediction.addressComponents}");
        }, // this callback is called when fetchPlaceDetailsWithCoordinates is true
        onSuggestionClicked: (prediction) {
         controller.text = prediction.description;
          controller.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description.length));
        }
    )

Integrate the Google AutoComplete TextField Widget in your Web code 🌐

In case you're building for the web, you need to pass the widget a proxy URL, otherwise you will receive a CORS-Error, as there are calls to the Google Maps API being made from the frontend. If you are not Google, your domain will probably be different, thus leading to the CORS-Error. If you are Google: how ya doin 😏? I'd love to do an internship.

Customization Option

You can customize the GooglePlacesAutoCompleteTextFormField as you would with any other TextFormField.

Julien Caselmann GitHub avatar
GitHub 작성자

Julien Caselmann ↗

👨🏻‍💻Founding Engineer @uplane-com

Uplane Inc.San Francisco
언어DartHTMLSwiftKotlinObjective-C

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 6 개

  • flutter{"sdk":"flutter"}
  • dio^5.9.0
  • rxdart^0.28.0
  • async^2.13.0
  • flutter_test개발 의존성{"sdk":"flutter"}
  • flutter_lints개발 의존성^6.0.0

프로젝트에 맞는 저장소를 선택하려면?

사용 목적에 따라 검색하고 개발 활동을 비교한 뒤 원본 저장소에서 요구 사항을 확인하세요.

  1. 이름, 작성자 또는 설명으로 검색하고 기술 주제로 범위를 좁힙니다.
  2. 스타, 포크, 최근 푸시를 함께 비교하세요. 스타는 관심의 지표이며 품질을 보장하지 않습니다.
  3. 사용하기 전에 GitHub에서 README, 라이선스, Issues를 확인하세요.

출처 및 관리

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗