パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細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向けのFlutterアプリ用にカスタマイズ可能な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 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。

ランキング