搜尋套件、儲存庫與 APP 分類

套件詳情v0.3.0

flutter_google_places_sdk_windows

Flutter 插件 for google places sdk 的 Windows 實作

Windows
近 30 天下載
4.5萬
喜歡數
0
Pub 分數
150

安裝套件

flutter pub add flutter_google_places_sdk_windows

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

適用於 Windows 的 Flutter 插件實作,用於 Google Places SDK,讓開發者能將 Google 的地點搜尋與自動補完功能整合至 Windows 應用程式。它可讓使用者發現地點、取得地點詳細資料,並在執行於 Windows 上的 Flutter 應用中直接進行地理編碼。此套件設計為與廣泛的 Flutter 生態系統無縫運作,並利用原生 Windows 功能以達成最佳效能。

適用情境

  • 在 Windows 桌面應用程式中整合地點自動完成
  • 使用 Google Places API 搜尋位置
  • 在 Windows 應用程式中顯示位置建議
  • 透過即時地點預測提升使用者體驗
  • 為 Windows 建構旅遊或物流應用

主要特色

  • 原生 Windows 平台整合
  • 支援地點自動補全與詳細資訊檢索
  • 與 Flutter 的跨平台工作流程相容
  • 在底層使用 Google Places API
  • 輕量且易於設定

適合對象

  • 使用位置功能開發 Windows 桌面應用的開發者
  • 在 Windows 上需要 Google Places 功能的應用程式
  • 針對多平台部署的Flutter團隊

使用建議

  • 需要設定 Google Places API 金鑰
  • 僅限 Windows 平台
  • 依賴網路連線進行API呼叫
  • 生產部署可能需要額外的設定

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_google_places_sdk

pub package

Tests

A Flutter plugin for google places sdk that uses the native libraries on each platform. Check out Rational below to understand why you should use this plugin.

Usage

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

Web Usage

When using the web support you also need to enable the Maps JavaScript API in google cloud:

https://developers.google.com/maps/documentation/javascript/get-api-key

Limits:

  • Location restriction is not supported. See google issue tracker for more info: https://issuetracker.google.com/issues/36219203

Rational

By now you probably found some other plugins, and wondering why this one was even created. Well, there's a good reason for that.

All other plugins will use http web requests rather than the native sdk.

Google allows you to limit the usage of your api key to your android application. However, that only works when you're using the native SDK.

So when using the http web requests method, you can't actually limit it, and if someone can get your API key (usually not a problem if it's in a mobile client), it can be used anywhere outside of it.

Example

import 'package:flutter/material.dart';
import 'package:flutter_google_places_sdk/flutter_google_places_sdk.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      body: Center(
        child: ElevatedButton(
          onPressed: () async {
            final places = FlutterGooglePlacesSdk('my-key');
            final predictions =
                await places.findAutocompletePredictions('Tel Aviv');
            print('Result: $predictions');
          },
          child: Text('Predict and print to console'),
        ),
      ),
    ),
  ));
}

Development & Contributing

This is a side project of mine, hence issues are usually dealt with on weekends.

PRs are more than welcome if anyone want to contribute. There are

Contribution Guidelines
  1. General code quality will adhere to new PRs, although nothing too strict. Specifics will discussed in each PRs.
  2. This is a multi-platform plugin, and each package is maintained independently. As part of it, each commit that changes the version is also tagged per platform. The result is that changes that require multiple packages will require multiple commits - and hence multiple PRs.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。

所在榜單