Coder Social home page Coder Social logo

hoc081098 / flutter_google_places_hoc081098 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fluttercommunity/flutter_google_places

17.0 2.0 27.0 14.01 MB

Better flutter_google_places, updated by @hoc081098

Home Page: https://pub.dev/packages/flutter_google_places_hoc081098

License: Other

Dart 95.94% Objective-C 0.05% Kotlin 0.14% Swift 0.48% HTML 1.79% Ruby 1.61%
google-places-autocomplete-api flutter-google-places

flutter_google_places_hoc081098's Introduction

flutter_google_places_hoc081098

All Contributors

Google places autocomplete widgets for flutter.

Updated by @hoc081098. See files changed

Pub Hits Build example

Liked some of my work? Buy me a coffee (or more likely a beer). Thanks for your support ❤️

Buy Me A Coffee

  • Migrated to null-safety.
  • Updated dependencies to latest release.
  • Refactoring by using RxDart for more power.
  • Fixed many issues.
  • Applied flutter_lints.
  • Refactored example, migrated to Android v2 embedding.
dependencies:
  flutter:
    sdk: flutter
  flutter_google_places_hoc081098: <last-version>

Simple usage

According to https://stackoverflow.com/a/52545293, you need to enable billing on your account, even if you are only using the free quota.

// replace flutter_google_places by flutter_google_places_hoc081098
import 'package:flutter_google_places_hoc081098/flutter_google_places_hoc081098.dart';

const kGoogleApiKey = 'API_KEY';

void onError(PlacesAutocompleteResponse response) {
  ScaffoldMessenger.of(context).showSnackBar(
    SnackBar(
      content: Text(response.errorMessage ?? 'Unknown error'),
    ),
  );
}

final Prediction? p = await PlacesAutocomplete.show(
  context: context,
  apiKey: kGoogleApiKey,
  onError: onError,
  mode: Mode.overlay, // or Mode.fullscreen
  language: 'fr',
  components: [Component(Component.country, 'fr')],
);

The library use google_maps_webservice library which directly refer to the official documentation for google maps web service.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Petrus Nguyễn Thái Học

💻 🚧

Corentin Giraud

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

flutter_google_places_hoc081098's People

Contributors

aallport avatar abbasidaniyal avatar allcontributors[bot] avatar anlarosa avatar asdamp avatar awhitford avatar billsakkas avatar corentingiraud avatar darioielardi avatar deepchandyadav avatar dereklakin avatar fauzipadlaw avatar harshshredding avatar hoc081098 avatar ivanespitiac avatar jeroen-meijer avatar josh-burton avatar kevmorelli avatar krispypen avatar lejard-h avatar lucazzp avatar mnalsup avatar raghav39 avatar shakes80 avatar stevenspiel avatar superciccio avatar zeshuaro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter_google_places_hoc081098's Issues

Something is wrong with pug get version

Hi,

I have an error on dependencies

dependencies: flutter: sdk: flutter flutter_google_places_hoc081098: ^1.0.0-nullsafety.0

Error on line 18, column 10 of pubspec.yaml: "version" field must have three numeric components: major, minor, and patch. Instead of "0.1", consider "0.1.0". ╷ 18 │ version: 0.1 │ ^^^ ╵ pub get failed (65; ╵)

not wrking

image
Shows blank screen with this error, PS i dont have any firebase plugins only using google maps not firebase
image

请问这是什么意思?

[flutter_google_places_hoc081098] input='SFO', location=null, origin=null
[flutter_google_places_hoc081098] ERROR ClientException: XMLHttpRequest error., uri=https://maps.googleapis.com/maps/api/place/autocomplete/json?input=SFO&language=fr&components=country%3Afr&key=AIzaSyDsesRQsdjmhTbCLktsi5oGZBsfF-KvpSY http://localhost:3000/dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 941:28 get current
http://localhost:3000/packages/http/src/browser_client.dart 95:22
http://localhost:3000/dart-sdk/lib/async/zone.dart 1661:54 runUnary
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 162:18 handleValue
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 846:44 handleValueCallback
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 875:13 _propagateToListeners
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 638:7 [_complete]
http://localhost:3000/dart-sdk/lib/async/stream_pipe.dart 59:43
http://localhost:3000/dart-sdk/lib/async/zone.dart 1655:54 run
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 205:18 handleWhenComplete
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 816:38 handleWhenCompleteCallback
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 872:11 _propagateToListeners
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 647:5 [_completeWithValue]
http://localhost:3000/dart-sdk/lib/async/future_impl.dart 721:7 callback
http://localhost:3000/dart-sdk/lib/async/schedule_microtask.dart 40:11 _microtaskLoop
http://localhost:3000/dart-sdk/lib/async/schedule_microtask.dart 49:5 _startMicrotaskLoop
http://localhost:3000/dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 181:7

Prediction is not showing in web

When i try to search its give me this error.

flutter_google_places_hoc081098] ERROR XMLHttpRequest error. dart-sdk/lib/_internal/js_dev_runtime/patch/core_patch.dart 906:28 get current
packages/http/src/browser_client.dart 71:22
dart-sdk/lib/async/zone.dart 1612:54 runUnary
dart-sdk/lib/async/future_impl.dart 152:18 handleValue
dart-sdk/lib/async/future_impl.dart 704:44 handleValueCallback
dart-sdk/lib/async/future_impl.dart 733:13 _propagateToListeners
dart-sdk/lib/async/future_impl.dart 530:7 [_complete]
dart-sdk/lib/async/stream_pipe.dart 61:11 _cancelAndValue
dart-sdk/lib/async/stream.dart 1219:7
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 324:14 _checkAndCall
dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/operations.dart 329:39 dcall
dart-sdk/lib/html/dart2js/html_dart2js.dart 37307:58

Prediction is not showing on flutter web build version

I am working on web project, used this plugin, locally it's working fine (localhost version) but when I am using build version and hosted it to Firebase hosting prediction is not showing. What would be the possible reason? I am using CustomSearchScaffold

Here's my

`flutter doctor -v
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.2.1 21D62 darwin-x64, locale en-DE)
• Flutter version 3.0.2 at /Users/almamun/Documents/developer/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision cd41fdd495 (4 weeks ago), 2022-06-08 09:52:13 -0700
• Engine revision f15f824b57
• Dart version 2.17.3
• DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
• Android SDK at /Users/almamun/Library/Android/sdk
• Platform android-33, build-tools 33.0.0-rc2
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[✓] VS Code (version 1.67.2)
• VS Code at /Users/almamun/Downloads/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-x64 • macOS 12.2.1 21D62 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.114

[✓] HTTP Host Availability
• All required HTTP hosts are available

• No issues found!
`

CORS Error

Get a CORS error when searching for a place:
Screen Shot 2021-07-20 at 12 05 04 AM

issues needs to fix

if user selected any predictions then predictions should be empty and the text field also should be empty. and give some customisation in the text field , on changed in the autocomplete.

Not Working for flutter web

image
Shows blank screen with this error, PS i dont have any firebase plugins only using google maps not firebase

Dapendencies update

Hi.

Please update the dependencies to the latest version as it's becoming an issue with compatibility with other packages.

Thank you for your work.

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.