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

패키지 상세v2.1.1

google_places_flutter

Android 및 iOS 모두를 위한 사용자 지정 Google 장소 자동 완성 위젯입니다. https://pub.dev/packages/google_places_flutter 를 사용하세요

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
9.4만
좋아요
100
Pub 점수
130

패키지 설치

flutter pub add google_places_flutter

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Android, iOS, Web, macOS, Windows, Linux용 플러터 앱을 위한 사용자 정의 가능한 Google 장소 자동 완성 위젯입니다. Google 장소 API로 제공되는 실시간 제안을 통해 사용자가 위치를 검색할 수 있습니다. 폼이나 지도에 장소 선택 기능을 간편하게 통합할 수 있으며, 다양한 플랫폼에서 원활한 경험을 제공합니다. 개발자는 외관을 맞춤 설정하고 장소 선택을 처리하며 위치 쿼리를 효율적으로 관리할 수 있습니다. 주소 입력, 위치 기반 서비스 또는 지오코딩 기능이 필요한 애플리케이션에 적합합니다.

사용 사례

  • 양식에서 주소 입력
  • 위치 기반 앱 기능
  • 지오코딩 및 지도 통합
  • 여행 및 배송 앱
  • 사용자 프로필 위치 설정
  • 이벤트 장소 선택

주요 기능

  • 실시간 장소 제안
  • 크로스 플랫폼 지원
  • 사용자 지정 가능한 UI
  • 장소 세부 정보 검색
  • 간편한 API 통합
  • 여러 플랫폼을 지원합니다

적합한 대상

  • 위치 검색이 필요한 모바일 및 웹 앱
  • Google Places API를 사용하는 개발자
  • 정확한 주소 입력이 필요한 앱
  • 위치 인식 애플리케이션
  • 크로스 플랫폼 솔루션을 구축하는 팀

고려 사항

  • Google Places API 키가 필요합니다
  • 사용 비용이 발생할 수 있습니다
  • 인터넷 연결에 의존합니다
  • 자동 완성 드롭다운의 사용자 정의가 제한적
  • 제안의 잠재적 지연
  • API 실패에 대한 적절한 오류 처리가 필요합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

google_places_flutter

Add dependency into pubspec.yml

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

Google AutoComplete TextField Widget code

    GooglePlaceAutoCompleteTextField(
        textEditingController: controller,
        googleAPIKey: "YOUR_GOOGLE_API_KEY",
        inputDecoration: InputDecoration()
        debounceTime: 800 // default 600 ms,
        countries: ["in","fr"],// optional by default null is set
        isLatLngRequired:true,// if you required coordinates from place detail
        getPlaceDetailWithLatLng: (Prediction prediction) {
         // this method will return latlng with place detail
        print("placeDetails" + prediction.lng.toString());
        }, // this callback is called when isLatLngRequired is true
        itemClick: (Prediction prediction) {
         controller.text=prediction.description;
          controller.selection = TextSelection.fromPosition(TextPosition(offset: prediction.description.length));
        }
        // if we want to make custom list item builder
        itemBuilder: (context, index, Prediction prediction) {
          return Container(
            padding: EdgeInsets.all(10),
            child: Row(
              children: [
                Icon(Icons.location_on),
                SizedBox(
                  width: 7,
                ),
                Expanded(child: Text("${prediction.description??""}"))
              ],
            ),
          );
        }
        // if you want to add seperator between list items
        seperatedBuilder: Divider(),
        // want to show close icon 
        isCrossBtnShown: true,
        // optional container padding
         containerHorizontalPadding: 10,
         // place type
        placeType: PlaceType.geocode,
        // keyboard type (defaults to TextInputType.streetAddress)
        keyboardType: TextInputType.text, // optional - defaults to streetAddress for better address input
         
         
        
        
    )
    

Customization Option

You can customize a text field input decoration and debounce time

Screenshorts

카테고리

의존성

의존성 목록 2 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.

순위