FLUTTER ECOSYSTEM

jaxnz/flutter_google_places_web

jaxnz/flutter_google_places_web open-source repository details.

flutter_google_places_web 專案封面
Stars
22
Forks
25
最近推送(UTC)
2025年7月31日
專案狀態
未封存
Jackson Lee GitHub avatar
GITHUB User

Jackson Lee ↗

語言DartHTML

此儲存庫發佈的套件

使用的依賴

依賴清單 5 項

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

Flutter Google Places Web

pub version donate

A web designed form field for Google Places Autocomplete

flutterwebplaces

API key

To use this library you need a Web API key. Here

Usage

FlutterGooglePlacesWeb is a Google Places Autocomplete field for Flutter Web.

import  'package:flutter_google_places_web/flutter_google_places_web.dart';

FlutterGooglePlacesWeb(
apiKey: <GOOGLE_API_KEY>,
proxyURL: 'https://cors-anywhere.herokuapp.com/',
components: 'country:us',
),

If you have XMLHttpRequest errors, please use a proxy. For more information please see cors-anywhere

If you are using the demo CORS Anywhere proxy (included in the example) - please allow temporary access or use your own proxy

If a user types and selects 1600 Amphitheatre Parkway you can retrieve the data

String name = FlutterGooglePlacesWeb.value['name'];
String streetAddress = FlutterGooglePlacesWeb.value['streetAddress'];
String city = FlutterGooglePlacesWeb.value['city'];
String country = FlutterGooglePlacesWeb.value['country'];

print(name); // '1600 Amphitheatre Parkway, Mountain View, CA, USA'
print(streetAddress); // '1600 Amphitheatre Parkway'
print(city); // 'CA'
print(country); // 'USA'

Roadmap

  • [Coming soon] Add mutliplatform support and remove CORS issues by having javascript API rather than http requests