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

place_picker のカバー
パッケージ詳細v0.10.0

place_picker

Flutter用に完全にDartで書かれた場所ピッカー。自動補完の提案と近隣の場所リストを備えています。ローカライゼーションも対応しています。

30日間ダウンロード
322
いいね数
147
Pub ポイント
60

パッケージをインストール

flutter pub add place_picker

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Place Picker は、場所の選択を可能にする完全に Dart で書かれた Flutter パッケージであり、自動補完の提案と近隣の場所リストを提供します。ローカリゼーションをサポートしており、マルチリンガルなユーザー体験を実現できます。Flutter アプリへのスムーズな統合を目的としており、直感的な UI コンポーネントにより住所や場所の入力を簡素化します。正確な地理情報の取得には Google Maps をバックエンドで活用し、スマートな提案とリアルタイムフィードバックによってユーザー体験を向上させます。正確な場所選択が必要なアプリに最適です。

用途

  • フォーム内の住所入力
  • 配達サービスの場所選択
  • 旅行およびマッピングアプリケーション
  • ユーザー プロファイルの場所設定
  • イベントまたは会場の登録

主な機能

  • 自動補完の提案
  • 近隣の場所リスト
  • 組み込みのローカリゼーション
  • Google マップの統合
  • 完全にカスタマイズ可能なUI
  • 純 Dart 実装

適している対象

  • 位置入力が必要なモバイルアプリ
  • 国際ユーザーをターゲットにしたアプリ
  • 純粋なDartソリューションを使用する開発者
  • 軽量な場所ピッカーを必要とするプロジェクト
  • 地図機能を備えたFlutterアプリ

注意事項

  • Google Maps API キーが必要です
  • Google Maps ベースのバックエンドに限定
  • カスタムテーマ用に追加のスタイルが必要になる場合があります
  • インターネット接続に依存します
  • オフラインでの場所選択には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Place Picker Pub

The missing location picker made in Flutter for Flutter. With dark theme and custom localization support.

⚠️ Please note: This library will NOT be affected by the deprecation of Place Picker as indicated here.

🍭 Remember to enable Places API, Maps SDK for Android, Maps SDK for iOS and Geocoding API for your API key.

Usage

To use this plugin, add place_picker as a dependency in your pubspec.yaml file.

Getting Started

This package relies on google_maps_flutter to display the map. Follow these guidelines to add your API key to the Android and iOS packages.

Get an API key at https://cloud.google.com/maps-platform/ if you haven't already.

Android

Specify your API key in the application manifest android/app/src/main/AndroidManifest.xml and add ACCESS_FINE_LOCATION permission:

<manifest ...

  <!-- Add this permission -->
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

  <application ...
    <!-- Add your api key here -->
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/>
    <activity ..../>
  </application>
</manifest>

Update your gradle.properties file with this:

android.enableJetifier=true
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536M

Please also make sure that you have those dependencies in your build.gradle:

  // parent level build.gradle (android/build.gradle)
  dependencies {
      classpath 'com.android.tools.build:gradle:3.3.0'
      classpath 'com.google.gms:google-services:4.2.0'
  }
  ...

  // app level build.gradle (android/app/build.gradle)
  compileSdkVersion 28
iOS

Specify your API key in the application delegate ios/Runner/AppDelegate.m:

#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#import "GoogleMaps/GoogleMaps.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
    didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GMSServices provideAPIKey:@"YOUR KEY HERE"];
  [GeneratedPluginRegistrant registerWithRegistry:self];
  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end

Or in your swift code, specify your API key in the application delegate ios/Runner/AppDelegate.swift:

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR KEY HERE")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

info.plist

Also add these to the dict values in Info.plist for location request to work on iOS info.plist

Sample Usage

Import the package into your code

import 'package:place_picker/place_picker.dart';

Create a method like below, and call it in onTap of a button or InkWell. A LocationResult will be returned with the name and lat/lng of the selected place. You can then handle the result in any way you want. Pass in an optional LatLng displayLocation to display that location instead. This is useful when you want the map to display the previously selected location.

void showPlacePicker() async {
    LocationResult result = await Navigator.of(context).push(MaterialPageRoute(
        builder: (context) =>
            PlacePicker("YOUR API KEY",
                        displayLocation: customLocation,
                        )));

    // Handle the result in your way
    print(result);
}

カテゴリー

依存関係

依存関係一覧 3 件

ソースリポジトリ

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

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