Git Product home page Git Product logo

google_place's Introduction

google_place

Discontinued

This project is no longer maintained, and will not receive further updates.

A Flutter plugin for iOS and Android and Web that provides a Google Place API.

Preview

The Places API is a service that returns information about places using HTTP requests. Places are defined within this API as establishments, geographic locations, or prominent points of interest.

The following place requests are available:

  1. Place Search returns a list of places based on a user's location or search string.
  2. Place Details returns more detailed information about a specific place, including user reviews.
  3. Place Photos provides access to the millions of place-related photos stored in Google's Place database.
  4. Place Autocomplete automatically fills in the name and/or address of a place as users type.
  5. Query Autocomplete provides a query prediction service for text-based geographic searches, returning suggested queries as users type.

Usage

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

Getting Started

Example

Sample Usage

  • Place Autocomplete
var googlePlace = GooglePlace("Your-Key");
var result = await googlePlace.autocomplete.get("1600 Amphitheatre");
  • Place Query Autocomplete
var googlePlace = GooglePlace("Your-Key");
var result = await googlePlace.queryAutocomplete.get("pizza near sydne");
  • Place Photos
var googlePlace = GooglePlace("Your-Key");
Uint8List result = await googlePlace.photos.get(
 "CnRtAAAATLZNl354RwP_9UKbQ_5Psy40texXePv4oAlgP4qNEkdIrkyse7rPXYGd9D_Uj1rVsQdWT4oRz4QrYAJNpFX7rzqqMlZw2h2E2y5IKMUZ7ouD_SlcHxYq1yL4KbKUv3qtWgTK0A6QbGh87GB3sscrHRIQiG2RrmU_jF4tENr9wGS_YxoUSSDrYjWmrNfeEHSGSc3FyhNLlBU", null, 400);
  • Place Details
var googlePlace = GooglePlace("Your-Key");
Uint8List result = await googlePlace.details.get("ChIJN1t_tDeuEmsRUsoyG83frY4",
        fields: "name,rating,formatted_phone_number")
  • Place Search

    • Find Place

      var googlePlace = GooglePlace("Your-Key");
      var result = await googlePlace.search.getFindPlace(
          "Museum of Contemporary Art Australia", InputType.TextQuery);
    • Nearby Search

      var googlePlace = GooglePlace("Your-Key");
      var result = await googlePlace.search.getNearBySearch(
          Location(lat: -33.8670522, lng: 151.1957362), 1500,
          type: "restaurant", keyword: "cruise");
    • Text Search

      var googlePlace = GooglePlace("Your-Key");
      var result = await googlePlace.search.getTextSearch("restaurants in Sydney");

Custom Headers

Now is possible to set custom header to use platform-specific API keys where you must provide the following headers.

final headers = <String, String>{
      if (defaultTargetPlatform == TargetPlatform.iOS)
        'x-ios-bundle-identifier': Env().bundleIdentifier, // com.my.app
      if (defaultTargetPlatform == TargetPlatform.android) ...{
        'x-android-package': Env().bundleIdentifier, // com.my.app
        'x-android-cert': Env().ANDROID_SIGNING_KEY_SHA1, // signing key used to build/publish the app
      }
    };
var googlePlace = GooglePlace("Your-Key", headers: headers);

Proxy URL for Web

Now is possible to set proxy url for web. proxyUrl can be formatted as [https:// || http://]host[:][/][?=]

var googlePlace = GooglePlace("Your-Key", proxyUrl: 'https://localhost:5000');

google_place's People

Contributors

acoutts avatar allanwolski avatar bazrafkan avatar desync-o-tron avatar diegoarredondo avatar ema987 avatar kuroshmondora avatar manafire avatar sachin-dahal avatar tusharm avatar vitor-bukovitz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.