├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── android
├── .gitignore
├── build.gradle
├── gradle.properties
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── kotlin
│ └── com
│ └── theantimony
│ └── googleplacespicker
│ └── GooglePlacesPickerPlugin.kt
├── example
├── .gitignore
├── .metadata
├── README.md
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle
│ │ └── src
│ │ │ └── main
│ │ │ ├── AndroidManifest.xml
│ │ │ └── res
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ └── values
│ │ │ └── styles.xml
│ ├── build.gradle
│ ├── gradle.properties
│ ├── settings.gradle
│ └── settings_aar.gradle
├── google_places_picker_example.iml
├── google_places_picker_example_android.iml
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ ├── Flutter.podspec
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── Runner
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Assets.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ ├── Contents.json
│ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ ├── Icon-App-20x20@1x.png
│ │ │ ├── Icon-App-20x20@2x.png
│ │ │ ├── Icon-App-20x20@3x.png
│ │ │ ├── Icon-App-29x29@1x.png
│ │ │ ├── Icon-App-29x29@2x.png
│ │ │ ├── Icon-App-29x29@3x.png
│ │ │ ├── Icon-App-40x40@1x.png
│ │ │ ├── Icon-App-40x40@2x.png
│ │ │ ├── Icon-App-40x40@3x.png
│ │ │ ├── Icon-App-60x60@2x.png
│ │ │ ├── Icon-App-60x60@3x.png
│ │ │ ├── Icon-App-76x76@1x.png
│ │ │ ├── Icon-App-76x76@2x.png
│ │ │ └── Icon-App-83.5x83.5@2x.png
│ │ └── LaunchImage.imageset
│ │ │ ├── Contents.json
│ │ │ ├── LaunchImage.png
│ │ │ ├── LaunchImage@2x.png
│ │ │ ├── LaunchImage@3x.png
│ │ │ └── README.md
│ │ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ │ ├── Info.plist
│ │ └── main.m
├── lib
│ └── main.dart
└── pubspec.yaml
├── google_places_picker.iml
├── google_places_picker_android.iml
├── ios
├── .gitignore
├── Assets
│ └── .gitkeep
├── Classes
│ ├── GooglePlacesPickerPlugin.h
│ └── GooglePlacesPickerPlugin.m
└── google_places_picker.podspec
├── lib
└── google_places_picker.dart
├── pubspec.yaml
└── res
└── values
└── strings_en.arb
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 | .idea/
4 | **/android/gradle/**
5 | gradlew
6 | **/gradlew.bat
7 | .packages
8 | .pub/
9 | pubspec.lock
10 |
11 | build/
12 |
13 | **/.flutter-plugins-dependencies
14 | **/.last_build_id
15 | **/flutter_export_environment.sh
16 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [3.0.2] - 2021-04-20
2 |
3 | - Set text color for dark mode on iOS.
4 |
5 | ## [3.0.1] - 2021-03-30
6 |
7 | - Removed Google Maps Dependency for iOS.
8 |
9 | ## [3.0.0-nullsafety.0] - 2021-03-06
10 |
11 | - Migrated to null safety.
12 |
13 | ## [2.1.0+3] - 2020-11-04
14 |
15 | - Fixed build errors on iOS caused by the 4.0.0 release of the Places iOS SDK.
16 | - Locked the Places iOS SDK to '~>4.0'.
17 | - Updated Kotlin version for Android.
18 |
19 | ## [2.1.0+2] - 2019-12-31
20 |
21 | - Changed onActivityResult return value so other plugins work.
22 |
23 | ## [2.1.0+1] - 2019-12-31
24 |
25 | - Removed memory leak introduced in latest update.
26 |
27 | ## [2.1.0] - 2019-12-31
28 |
29 | - Updated plugin to use v2 Android embedding
30 | - Lowered Intent request code so it fits in the lower 16bits
31 | - Updated Android Google Places SDK
32 |
33 | ## [2.0.2+2] - 2019-09-16
34 |
35 | - Fixed swapped north-east and south-west coordinated on `bias` and `restriction`.
36 |
37 | ## [2.0.2+1] - 2019-06-03
38 |
39 | - Fixed Kotlin Smart Cast not working on certain setups.
40 |
41 | ## [2.0.2] - 2019-05-24
42 |
43 | - Updated Android Gradle and Kotlin versions.
44 |
45 | ## [2.0.1] - 2019-04-20
46 |
47 | - Added check for request code in `onActivityResult` so we don't swallow other plugins' callbacks.
48 |
49 | ## [2.0.0] - 2019-03-16
50 |
51 | - Added option to filter options via type filter, restrict bounds, bias bounds and country.
52 |
53 | ## [1.0.0] - 2019-03-16
54 |
55 | - Removed Place Picker from plugin as it is deprecated by Google
56 |
57 | ## [0.1.0] - 2019-01-19
58 |
59 | - Fixed crashes on iOS devices when canceling the Place Picker or the Autocomplete
60 |
61 | ## [0.0.9] - 2018-11-03
62 |
63 | - Fixed more Android build errors
64 |
65 | ## [0.0.8] - 2018-11-03
66 |
67 | - Updated Kotlin version
68 |
69 | ## [0.0.7] - 2018-11-03
70 |
71 | - Fixed compile error on Flutter 0.10.x
72 |
73 | ## [0.0.6] - 2018-09-21
74 |
75 | - Fixed scenario where random point selected in the Place Picker would crash the app due to no address
76 |
77 | ## [0.0.5] - 2018-09-03
78 |
79 | - Updated sdk dependency for flutter 0.6.0
80 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # google_places_picker
2 |
3 | Google Places Autocomplete for Flutter
4 |
5 | ## Getting Started
6 |
7 | ### Setting up
8 | 1. Run the `initialize` method in your `main.dart`'s `initState` (or anywhere it would only be called once) with your API keys as arguments:
9 | ```dart
10 | import 'package:google_places_picker/google_places_picker.dart';
11 |
12 | PluginGooglePlacePicker.initialize(
13 | androidApiKey: "YOUR_ANDROID_API_KEY",
14 | iosApiKey: "YOUR_IOS_API_KEY",
15 | );
16 | ```
17 |
18 | ### Usage
19 |
20 | You can use the plugin via the `showAutocomplete` methods, which takes a PlaceAutocompleteMode paramater to know whether to display the fullscreen or the overlay control on Android (it has no effect on iOS). It returns a `Place` object with the following properties:
21 |
22 | - name
23 | - id
24 | - address
25 | - latitude
26 | - longitude
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group 'com.theantimony.googleplacespicker'
2 | version '1.0-SNAPSHOT'
3 |
4 | buildscript {
5 | ext.kotlin_version = '1.7.22'
6 | repositories {
7 | google()
8 | jcenter()
9 | }
10 |
11 | dependencies {
12 | classpath 'com.android.tools.build:gradle:7.2.2'
13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
14 | }
15 | }
16 |
17 | rootProject.allprojects {
18 | repositories {
19 | google()
20 | jcenter()
21 | }
22 | }
23 |
24 | apply plugin: 'com.android.library'
25 | apply plugin: 'kotlin-android'
26 |
27 | android {
28 | compileSdkVersion 29
29 |
30 | sourceSets {
31 | main.java.srcDirs += 'src/main/kotlin'
32 | }
33 | defaultConfig {
34 | minSdkVersion 16
35 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
36 | }
37 | lintOptions {
38 | disable 'InvalidPackage'
39 | }
40 | }
41 |
42 | dependencies {
43 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
44 | api 'com.google.android.libraries.places:places:2.4.0'
45 | api 'androidx.appcompat:appcompat:1.2.0'
46 | implementation ("com.android.volley:volley:1.2.1")
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'google_places_picker'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/theantimony/googleplacespicker/GooglePlacesPickerPlugin.kt:
--------------------------------------------------------------------------------
1 | package com.theantimony.googleplacespicker
2 |
3 | import android.app.Activity
4 | import android.app.Activity.RESULT_CANCELED
5 | import android.app.Activity.RESULT_OK
6 | import android.content.Intent
7 | import com.google.android.gms.common.GooglePlayServicesNotAvailableException
8 | import com.google.android.gms.common.GooglePlayServicesRepairableException
9 | import com.google.android.gms.maps.model.LatLng
10 | import com.google.android.libraries.places.api.Places
11 | import com.google.android.libraries.places.api.model.Place
12 | import com.google.android.libraries.places.api.model.RectangularBounds
13 | import com.google.android.libraries.places.api.model.TypeFilter
14 | import com.google.android.libraries.places.widget.Autocomplete
15 | import com.google.android.libraries.places.widget.AutocompleteActivity
16 | import com.google.android.libraries.places.widget.model.AutocompleteActivityMode
17 | import io.flutter.embedding.engine.plugins.FlutterPlugin
18 | import io.flutter.embedding.engine.plugins.activity.ActivityAware
19 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
20 | import io.flutter.plugin.common.BinaryMessenger
21 | import io.flutter.plugin.common.MethodChannel
22 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler
23 | import io.flutter.plugin.common.MethodChannel.Result
24 | import io.flutter.plugin.common.MethodCall
25 | import io.flutter.plugin.common.PluginRegistry
26 | import io.flutter.plugin.common.PluginRegistry.Registrar
27 | import java.lang.Exception
28 |
29 |
30 | class GooglePlacesPickerPlugin() : FlutterPlugin, MethodCallHandler, PluginRegistry.ActivityResultListener, ActivityAware {
31 | var mActivity: Activity? = null
32 | var mChannel: MethodChannel? = null
33 | var mBinding: ActivityPluginBinding? = null
34 |
35 | private var mResult: Result? = null
36 | private val mFilterTypes = mapOf(
37 | Pair("address", TypeFilter.ADDRESS),
38 | Pair("cities", TypeFilter.CITIES),
39 | Pair("establishment", TypeFilter.ESTABLISHMENT),
40 | Pair("geocode", TypeFilter.GEOCODE),
41 | Pair("regions", TypeFilter.REGIONS)
42 | )
43 |
44 | companion object {
45 | const val PLACE_AUTOCOMPLETE_REQUEST_CODE = 57864
46 |
47 | @JvmStatic
48 | fun registerWith(registrar: Registrar) {
49 | val instance = GooglePlacesPickerPlugin().apply {
50 | mActivity = registrar.activity()
51 | }
52 | registrar.addActivityResultListener(instance)
53 | instance.onAttachedToEngine(registrar.messenger())
54 | }
55 | }
56 |
57 | override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
58 | onAttachedToEngine(binding.binaryMessenger)
59 | }
60 |
61 | private fun onAttachedToEngine(messenger: BinaryMessenger) {
62 | mChannel = MethodChannel(messenger, "plugin_google_place_picker")
63 | mChannel?.setMethodCallHandler(this)
64 | }
65 |
66 | override fun onMethodCall(call: MethodCall, result: Result) {
67 | mResult = result
68 | if (call.method.equals("showAutocomplete")) {
69 | showAutocompletePicker(
70 | call.argument("mode"),
71 | call.argument("bias"),
72 | call.argument("restriction"),
73 | call.argument("type"),
74 | call.argument("country")
75 | )
76 | } else if (call.method.equals("initialize")) {
77 | initialize(call.argument("androidApiKey"))
78 | } else {
79 | result.notImplemented()
80 | }
81 | }
82 |
83 | fun initialize(apiKey: String?) {
84 | if (apiKey.isNullOrEmpty()) {
85 | mResult?.error("API_KEY_ERROR", "Invalid Android API Key", null)
86 | return
87 | }
88 | try {
89 | if (!Places.isInitialized()) {
90 | mActivity?.let {
91 | Places.initialize(it.applicationContext, apiKey)
92 | }
93 | }
94 | mResult?.success(null)
95 | } catch (e: Exception) {
96 | mResult?.error("API_KEY_ERROR", e.localizedMessage, null)
97 | }
98 | }
99 |
100 | private fun showAutocompletePicker(
101 | mode: Int?,
102 | bias: HashMap?,
103 | restriction: HashMap?,
104 | type: String?,
105 | country: String?
106 | ) {
107 | val modeToUse = mode ?: 71
108 | val fields = listOf(
109 | Place.Field.ID,
110 | Place.Field.ADDRESS,
111 | Place.Field.NAME,
112 | Place.Field.LAT_LNG
113 | )
114 | var intentBuilder = Autocomplete.IntentBuilder(if (modeToUse == 71) AutocompleteActivityMode.OVERLAY else AutocompleteActivityMode.FULLSCREEN, fields)
115 |
116 | bias?.let {
117 | val locationBias = RectangularBounds.newInstance(
118 | LatLng(it["southWestLat"] ?: 0.0, it["southWestLng"] ?: 0.0),
119 | LatLng(it["northEastLat"] ?: 0.0, it["northEastLng"] ?: 0.0)
120 | )
121 | intentBuilder = intentBuilder.setLocationBias(locationBias)
122 | }
123 |
124 | restriction?.let {
125 | val locationRestriction = RectangularBounds.newInstance(
126 | LatLng(it["southWestLat"] ?: 0.0, it["southWestLng"] ?: 0.0),
127 | LatLng(it["northEastLat"] ?: 0.0, it["northEastLng"] ?: 0.0)
128 | )
129 | intentBuilder = intentBuilder.setLocationRestriction(locationRestriction)
130 | }
131 |
132 | type?.let {
133 | intentBuilder = intentBuilder.setTypeFilter(mFilterTypes[it])
134 | }
135 |
136 | country?.let {
137 | intentBuilder = intentBuilder.setCountry(it)
138 | }
139 |
140 | mActivity?.let {
141 | val intent = intentBuilder.build(it)
142 |
143 | try {
144 | it.startActivityForResult(intent, PLACE_AUTOCOMPLETE_REQUEST_CODE)
145 | } catch (e: GooglePlayServicesNotAvailableException) {
146 | mResult?.error("GooglePlayServicesNotAvailableException", e.message, null)
147 | } catch (e: GooglePlayServicesRepairableException) {
148 | mResult?.error("GooglePlayServicesRepairableException", e.message, null)
149 | }
150 | }
151 |
152 |
153 |
154 | }
155 |
156 | override fun onActivityResult(p0: Int, p1: Int, p2: Intent?): Boolean {
157 | if (p0 != PLACE_AUTOCOMPLETE_REQUEST_CODE) {
158 | return false
159 | }
160 | if (p1 == RESULT_OK && p2 != null) {
161 | val place = Autocomplete.getPlaceFromIntent(p2)
162 | val placeMap = mutableMapOf()
163 | placeMap.put("latitude", place.latLng?.latitude ?: 0.0)
164 | placeMap.put("longitude", place.latLng?.longitude ?: 0.0)
165 | placeMap.put("id", place.id ?: "")
166 | placeMap.put("name", place.name ?: "")
167 | placeMap.put("address", place.address ?: "")
168 | mResult?.success(placeMap)
169 | } else if (p1 == AutocompleteActivity.RESULT_ERROR && p2 != null) {
170 | val status = Autocomplete.getStatusFromIntent(p2)
171 | mResult?.error("PLACE_AUTOCOMPLETE_ERROR", status.statusMessage, null)
172 | } else if (p1 == RESULT_CANCELED) {
173 | mResult?.error("USER_CANCELED", "User has canceled the operation.", null)
174 | } else {
175 | mResult?.error("UNKNOWN", "Unknown error.", null)
176 | }
177 | return true
178 | }
179 |
180 | override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
181 | mActivity = null
182 | mChannel?.setMethodCallHandler(null)
183 | mBinding?.removeActivityResultListener(this)
184 | mChannel = null
185 | mBinding = null
186 | }
187 |
188 | override fun onDetachedFromActivity() {
189 | mActivity = null
190 | mBinding?.removeActivityResultListener(this)
191 | mBinding = null
192 | }
193 |
194 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
195 | mActivity = binding.activity
196 | mBinding = binding
197 | binding.addActivityResultListener(this)
198 | }
199 |
200 | override fun onAttachedToActivity(binding: ActivityPluginBinding) {
201 | mActivity = binding.activity
202 | mBinding = binding
203 | binding.addActivityResultListener(this)
204 | }
205 |
206 | override fun onDetachedFromActivityForConfigChanges() {
207 | mActivity = null
208 | mBinding?.removeActivityResultListener(this)
209 | mBinding = null
210 | }
211 | }
212 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | .dart_tool/
3 |
4 | .packages
5 | .pub/
6 |
7 | build/
8 |
9 | .flutter-plugins
10 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 8717a5e6f7d6aac3324d9a6decacfe2d597b6ea4
8 | channel: master
9 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # google_places_picker_example
2 |
3 | Demonstrates how to use the google_places_picker plugin.
4 |
5 | ## Getting Started
6 |
7 | For help getting started with Flutter, view our online
8 | [documentation](https://flutter.io/).
9 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | *.class
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | GeneratedPluginRegistrant.java
11 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | apply plugin: 'com.android.application'
15 | apply plugin: 'kotlin-android'
16 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
17 |
18 | android {
19 | compileSdkVersion flutter.compileSdkVersion
20 |
21 | sourceSets {
22 | main.java.srcDirs += 'src/main/kotlin'
23 | }
24 |
25 | lintOptions {
26 | disable 'InvalidPackage'
27 | }
28 |
29 | defaultConfig {
30 | applicationId "com.theantimony.googleplacespickerexample"
31 | minSdkVersion flutter.minSdkVersion
32 | targetSdkVersion flutter.targetSdkVersion
33 | versionCode 1
34 | versionName "1.0"
35 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
36 | }
37 |
38 | buildTypes {
39 | release {
40 | // TODO: Add your own signing config for the release build.
41 | // Signing with the debug keys for now, so `flutter run --release` works.
42 | profile {
43 | matchingFallbacks = ['debug', 'release']
44 | }
45 | signingConfig signingConfigs.debug
46 | }
47 | }
48 | }
49 |
50 | flutter {
51 | source '../..'
52 | }
53 |
54 | dependencies {
55 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
56 | testImplementation 'junit:junit:4.12'
57 | androidTestImplementation 'androidx.test:runner:1.2.0'
58 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
59 | }
60 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
8 |
9 |
10 |
15 |
18 |
25 |
28 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 |
2 |
3 | buildscript {
4 | ext.kotlin_version = '1.7.22'
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 |
10 | dependencies {
11 | classpath 'com.android.tools.build:gradle:7.2.2'
12 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
13 | }
14 | }
15 |
16 | allprojects {
17 | repositories {
18 | google()
19 | jcenter()
20 | }
21 | }
22 |
23 | rootProject.buildDir = '../build'
24 | subprojects {
25 | project.buildDir = "${rootProject.buildDir}/${project.name}"
26 | }
27 | subprojects {
28 | project.evaluationDependsOn(':app')
29 | }
30 |
31 | tasks.register("clean", Delete) {
32 | delete rootProject.buildDir
33 | }
34 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | android.enableJetifier=true
2 | android.useAndroidX=true
3 | org.gradle.jvmargs=-Xmx1536M
4 | android.enableR8=true
5 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/example/android/settings_aar.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/example/google_places_picker_example.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/example/google_places_picker_example_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/app.flx
37 | /Flutter/app.zip
38 | /Flutter/flutter_assets/
39 | /Flutter/App.framework
40 | /Flutter/Flutter.framework
41 | /Flutter/Generated.xcconfig
42 | /ServiceDefinitions.json
43 |
44 | Pods/
45 | .symlinks/
46 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Flutter.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # NOTE: This podspec is NOT to be published. It is only used as a local source!
3 | # This is a generated file; do not edit or check into version control.
4 | #
5 |
6 | Pod::Spec.new do |s|
7 | s.name = 'Flutter'
8 | s.version = '1.0.0'
9 | s.summary = 'High-performance, high-fidelity mobile apps.'
10 | s.homepage = 'https://flutter.io'
11 | s.license = { :type => 'MIT' }
12 | s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' }
13 | s.source = { :git => 'https://github.com/flutter/engine', :tag => s.version.to_s }
14 | s.ios.deployment_target = '8.0'
15 | # Framework linking is handled by Flutter tooling, not CocoaPods.
16 | # Add a placeholder to satisfy `s.dependency 'Flutter'` plugin podspecs.
17 | s.vendored_frameworks = 'path/to/nothing'
18 | end
19 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
32 | end
33 |
34 | post_install do |installer|
35 | installer.pods_project.targets.each do |target|
36 | flutter_additional_ios_build_settings(target)
37 | end
38 | end
39 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - google_places_picker (0.0.3):
4 | - Flutter
5 | - GooglePlaces (~> 4.0)
6 | - GoogleMaps/Base (4.1.0)
7 | - GooglePlaces (4.1.0):
8 | - GoogleMaps/Base (= 4.1.0)
9 |
10 | DEPENDENCIES:
11 | - Flutter (from `Flutter`)
12 | - google_places_picker (from `.symlinks/plugins/google_places_picker/ios`)
13 |
14 | SPEC REPOS:
15 | trunk:
16 | - GoogleMaps
17 | - GooglePlaces
18 |
19 | EXTERNAL SOURCES:
20 | Flutter:
21 | :path: Flutter
22 | google_places_picker:
23 | :path: ".symlinks/plugins/google_places_picker/ios"
24 |
25 | SPEC CHECKSUMS:
26 | Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c
27 | google_places_picker: 7bf77312e2791a727b37abb0f7c8fef39d98b14d
28 | GoogleMaps: 008e2c80e38605b56b560e8deb73d4194ff30bef
29 | GooglePlaces: a058b776259c13e1323c9ff135549cb1b13ad8e7
30 |
31 | PODFILE CHECKSUM: 8e679eca47255a8ca8067c4c67aab20e64cb974d
32 |
33 | COCOAPODS: 1.10.1
34 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 1746DB1F046AB0E0D5EE9164 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19E25792714BE3FB965EC59A /* libPods-Runner.a */; };
12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; };
14 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; };
15 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; };
16 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; };
17 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
18 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
19 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXCopyFilesBuildPhase section */
23 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
24 | isa = PBXCopyFilesBuildPhase;
25 | buildActionMask = 2147483647;
26 | dstPath = "";
27 | dstSubfolderSpec = 10;
28 | files = (
29 | );
30 | name = "Embed Frameworks";
31 | runOnlyForDeploymentPostprocessing = 0;
32 | };
33 | /* End PBXCopyFilesBuildPhase section */
34 |
35 | /* Begin PBXFileReference section */
36 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
37 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
38 | 19E25792714BE3FB965EC59A /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; };
39 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
40 | 5F12559B90E5FC70FCF0B8CF /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; };
41 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
42 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
43 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
44 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
45 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
46 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
47 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
48 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
49 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
50 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
51 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | B96246D3BB2F0D6C2E8161E6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; };
53 | /* End PBXFileReference section */
54 |
55 | /* Begin PBXFrameworksBuildPhase section */
56 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
57 | isa = PBXFrameworksBuildPhase;
58 | buildActionMask = 2147483647;
59 | files = (
60 | 1746DB1F046AB0E0D5EE9164 /* libPods-Runner.a in Frameworks */,
61 | );
62 | runOnlyForDeploymentPostprocessing = 0;
63 | };
64 | /* End PBXFrameworksBuildPhase section */
65 |
66 | /* Begin PBXGroup section */
67 | 6971A12EB4032BB6A29DB70E /* Frameworks */ = {
68 | isa = PBXGroup;
69 | children = (
70 | 19E25792714BE3FB965EC59A /* libPods-Runner.a */,
71 | );
72 | name = Frameworks;
73 | sourceTree = "";
74 | };
75 | 9740EEB11CF90186004384FC /* Flutter */ = {
76 | isa = PBXGroup;
77 | children = (
78 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
79 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
80 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
81 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
82 | );
83 | name = Flutter;
84 | sourceTree = "";
85 | };
86 | 97C146E51CF9000F007C117D = {
87 | isa = PBXGroup;
88 | children = (
89 | 9740EEB11CF90186004384FC /* Flutter */,
90 | 97C146F01CF9000F007C117D /* Runner */,
91 | 97C146EF1CF9000F007C117D /* Products */,
92 | A0DC1BDAD6B0CD2E9549CB71 /* Pods */,
93 | 6971A12EB4032BB6A29DB70E /* Frameworks */,
94 | );
95 | sourceTree = "";
96 | };
97 | 97C146EF1CF9000F007C117D /* Products */ = {
98 | isa = PBXGroup;
99 | children = (
100 | 97C146EE1CF9000F007C117D /* Runner.app */,
101 | );
102 | name = Products;
103 | sourceTree = "";
104 | };
105 | 97C146F01CF9000F007C117D /* Runner */ = {
106 | isa = PBXGroup;
107 | children = (
108 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */,
109 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */,
110 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
111 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
112 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
113 | 97C147021CF9000F007C117D /* Info.plist */,
114 | 97C146F11CF9000F007C117D /* Supporting Files */,
115 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
116 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
117 | );
118 | path = Runner;
119 | sourceTree = "";
120 | };
121 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
122 | isa = PBXGroup;
123 | children = (
124 | 97C146F21CF9000F007C117D /* main.m */,
125 | );
126 | name = "Supporting Files";
127 | sourceTree = "";
128 | };
129 | A0DC1BDAD6B0CD2E9549CB71 /* Pods */ = {
130 | isa = PBXGroup;
131 | children = (
132 | 5F12559B90E5FC70FCF0B8CF /* Pods-Runner.debug.xcconfig */,
133 | B96246D3BB2F0D6C2E8161E6 /* Pods-Runner.release.xcconfig */,
134 | );
135 | name = Pods;
136 | sourceTree = "";
137 | };
138 | /* End PBXGroup section */
139 |
140 | /* Begin PBXNativeTarget section */
141 | 97C146ED1CF9000F007C117D /* Runner */ = {
142 | isa = PBXNativeTarget;
143 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
144 | buildPhases = (
145 | 4AE463DC7A18CF96F21C9CE2 /* [CP] Check Pods Manifest.lock */,
146 | 9740EEB61CF901F6004384FC /* Run Script */,
147 | 97C146EA1CF9000F007C117D /* Sources */,
148 | 97C146EB1CF9000F007C117D /* Frameworks */,
149 | 97C146EC1CF9000F007C117D /* Resources */,
150 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
151 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
152 | AF17A22B3C05FB042A4BA7D7 /* [CP] Copy Pods Resources */,
153 | );
154 | buildRules = (
155 | );
156 | dependencies = (
157 | );
158 | name = Runner;
159 | productName = Runner;
160 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
161 | productType = "com.apple.product-type.application";
162 | };
163 | /* End PBXNativeTarget section */
164 |
165 | /* Begin PBXProject section */
166 | 97C146E61CF9000F007C117D /* Project object */ = {
167 | isa = PBXProject;
168 | attributes = {
169 | LastUpgradeCheck = 0910;
170 | ORGANIZATIONNAME = "The Chromium Authors";
171 | TargetAttributes = {
172 | 97C146ED1CF9000F007C117D = {
173 | CreatedOnToolsVersion = 7.3.1;
174 | };
175 | };
176 | };
177 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
178 | compatibilityVersion = "Xcode 3.2";
179 | developmentRegion = English;
180 | hasScannedForEncodings = 0;
181 | knownRegions = (
182 | en,
183 | Base,
184 | );
185 | mainGroup = 97C146E51CF9000F007C117D;
186 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
187 | projectDirPath = "";
188 | projectRoot = "";
189 | targets = (
190 | 97C146ED1CF9000F007C117D /* Runner */,
191 | );
192 | };
193 | /* End PBXProject section */
194 |
195 | /* Begin PBXResourcesBuildPhase section */
196 | 97C146EC1CF9000F007C117D /* Resources */ = {
197 | isa = PBXResourcesBuildPhase;
198 | buildActionMask = 2147483647;
199 | files = (
200 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
201 | 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */,
202 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
203 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */,
204 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
205 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
206 | );
207 | runOnlyForDeploymentPostprocessing = 0;
208 | };
209 | /* End PBXResourcesBuildPhase section */
210 |
211 | /* Begin PBXShellScriptBuildPhase section */
212 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
213 | isa = PBXShellScriptBuildPhase;
214 | buildActionMask = 2147483647;
215 | files = (
216 | );
217 | inputPaths = (
218 | );
219 | name = "Thin Binary";
220 | outputPaths = (
221 | );
222 | runOnlyForDeploymentPostprocessing = 0;
223 | shellPath = /bin/sh;
224 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
225 | };
226 | 4AE463DC7A18CF96F21C9CE2 /* [CP] Check Pods Manifest.lock */ = {
227 | isa = PBXShellScriptBuildPhase;
228 | buildActionMask = 2147483647;
229 | files = (
230 | );
231 | inputPaths = (
232 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
233 | "${PODS_ROOT}/Manifest.lock",
234 | );
235 | name = "[CP] Check Pods Manifest.lock";
236 | outputPaths = (
237 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
238 | );
239 | runOnlyForDeploymentPostprocessing = 0;
240 | shellPath = /bin/sh;
241 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
242 | showEnvVarsInLog = 0;
243 | };
244 | 9740EEB61CF901F6004384FC /* Run Script */ = {
245 | isa = PBXShellScriptBuildPhase;
246 | buildActionMask = 2147483647;
247 | files = (
248 | );
249 | inputPaths = (
250 | );
251 | name = "Run Script";
252 | outputPaths = (
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | shellPath = /bin/sh;
256 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
257 | };
258 | AF17A22B3C05FB042A4BA7D7 /* [CP] Copy Pods Resources */ = {
259 | isa = PBXShellScriptBuildPhase;
260 | buildActionMask = 2147483647;
261 | files = (
262 | );
263 | inputPaths = (
264 | "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh",
265 | "${PODS_ROOT}/GooglePlaces/Frameworks/GooglePlaces.framework/Resources/GooglePlaces.bundle",
266 | );
267 | name = "[CP] Copy Pods Resources";
268 | outputPaths = (
269 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GooglePlaces.bundle",
270 | );
271 | runOnlyForDeploymentPostprocessing = 0;
272 | shellPath = /bin/sh;
273 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
274 | showEnvVarsInLog = 0;
275 | };
276 | /* End PBXShellScriptBuildPhase section */
277 |
278 | /* Begin PBXSourcesBuildPhase section */
279 | 97C146EA1CF9000F007C117D /* Sources */ = {
280 | isa = PBXSourcesBuildPhase;
281 | buildActionMask = 2147483647;
282 | files = (
283 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */,
284 | 97C146F31CF9000F007C117D /* main.m in Sources */,
285 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
286 | );
287 | runOnlyForDeploymentPostprocessing = 0;
288 | };
289 | /* End PBXSourcesBuildPhase section */
290 |
291 | /* Begin PBXVariantGroup section */
292 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
293 | isa = PBXVariantGroup;
294 | children = (
295 | 97C146FB1CF9000F007C117D /* Base */,
296 | );
297 | name = Main.storyboard;
298 | sourceTree = "";
299 | };
300 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
301 | isa = PBXVariantGroup;
302 | children = (
303 | 97C147001CF9000F007C117D /* Base */,
304 | );
305 | name = LaunchScreen.storyboard;
306 | sourceTree = "";
307 | };
308 | /* End PBXVariantGroup section */
309 |
310 | /* Begin XCBuildConfiguration section */
311 | 97C147031CF9000F007C117D /* Debug */ = {
312 | isa = XCBuildConfiguration;
313 | buildSettings = {
314 | ALWAYS_SEARCH_USER_PATHS = NO;
315 | CLANG_ANALYZER_NONNULL = YES;
316 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
317 | CLANG_CXX_LIBRARY = "libc++";
318 | CLANG_ENABLE_MODULES = YES;
319 | CLANG_ENABLE_OBJC_ARC = YES;
320 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
321 | CLANG_WARN_BOOL_CONVERSION = YES;
322 | CLANG_WARN_COMMA = YES;
323 | CLANG_WARN_CONSTANT_CONVERSION = YES;
324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
325 | CLANG_WARN_EMPTY_BODY = YES;
326 | CLANG_WARN_ENUM_CONVERSION = YES;
327 | CLANG_WARN_INFINITE_RECURSION = YES;
328 | CLANG_WARN_INT_CONVERSION = YES;
329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
330 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
331 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
332 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
333 | CLANG_WARN_STRICT_PROTOTYPES = YES;
334 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
335 | CLANG_WARN_UNREACHABLE_CODE = YES;
336 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
337 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
338 | COPY_PHASE_STRIP = NO;
339 | DEBUG_INFORMATION_FORMAT = dwarf;
340 | ENABLE_STRICT_OBJC_MSGSEND = YES;
341 | ENABLE_TESTABILITY = YES;
342 | GCC_C_LANGUAGE_STANDARD = gnu99;
343 | GCC_DYNAMIC_NO_PIC = NO;
344 | GCC_NO_COMMON_BLOCKS = YES;
345 | GCC_OPTIMIZATION_LEVEL = 0;
346 | GCC_PREPROCESSOR_DEFINITIONS = (
347 | "DEBUG=1",
348 | "$(inherited)",
349 | );
350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
352 | GCC_WARN_UNDECLARED_SELECTOR = YES;
353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
354 | GCC_WARN_UNUSED_FUNCTION = YES;
355 | GCC_WARN_UNUSED_VARIABLE = YES;
356 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
357 | MTL_ENABLE_DEBUG_INFO = YES;
358 | ONLY_ACTIVE_ARCH = YES;
359 | SDKROOT = iphoneos;
360 | TARGETED_DEVICE_FAMILY = "1,2";
361 | };
362 | name = Debug;
363 | };
364 | 97C147041CF9000F007C117D /* Release */ = {
365 | isa = XCBuildConfiguration;
366 | buildSettings = {
367 | ALWAYS_SEARCH_USER_PATHS = NO;
368 | CLANG_ANALYZER_NONNULL = YES;
369 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
370 | CLANG_CXX_LIBRARY = "libc++";
371 | CLANG_ENABLE_MODULES = YES;
372 | CLANG_ENABLE_OBJC_ARC = YES;
373 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
374 | CLANG_WARN_BOOL_CONVERSION = YES;
375 | CLANG_WARN_COMMA = YES;
376 | CLANG_WARN_CONSTANT_CONVERSION = YES;
377 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
378 | CLANG_WARN_EMPTY_BODY = YES;
379 | CLANG_WARN_ENUM_CONVERSION = YES;
380 | CLANG_WARN_INFINITE_RECURSION = YES;
381 | CLANG_WARN_INT_CONVERSION = YES;
382 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
383 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
384 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
385 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
386 | CLANG_WARN_STRICT_PROTOTYPES = YES;
387 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
388 | CLANG_WARN_UNREACHABLE_CODE = YES;
389 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
390 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
391 | COPY_PHASE_STRIP = NO;
392 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
393 | ENABLE_NS_ASSERTIONS = NO;
394 | ENABLE_STRICT_OBJC_MSGSEND = YES;
395 | GCC_C_LANGUAGE_STANDARD = gnu99;
396 | GCC_NO_COMMON_BLOCKS = YES;
397 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
398 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
399 | GCC_WARN_UNDECLARED_SELECTOR = YES;
400 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
401 | GCC_WARN_UNUSED_FUNCTION = YES;
402 | GCC_WARN_UNUSED_VARIABLE = YES;
403 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
404 | MTL_ENABLE_DEBUG_INFO = NO;
405 | SDKROOT = iphoneos;
406 | TARGETED_DEVICE_FAMILY = "1,2";
407 | VALIDATE_PRODUCT = YES;
408 | };
409 | name = Release;
410 | };
411 | 97C147061CF9000F007C117D /* Debug */ = {
412 | isa = XCBuildConfiguration;
413 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
414 | buildSettings = {
415 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
416 | CURRENT_PROJECT_VERSION = 1;
417 | ENABLE_BITCODE = NO;
418 | FRAMEWORK_SEARCH_PATHS = (
419 | "$(inherited)",
420 | "$(PROJECT_DIR)/Flutter",
421 | );
422 | INFOPLIST_FILE = Runner/Info.plist;
423 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
424 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
425 | LIBRARY_SEARCH_PATHS = (
426 | "$(inherited)",
427 | "$(PROJECT_DIR)/Flutter",
428 | );
429 | PRODUCT_BUNDLE_IDENTIFIER = com.theantimony.googlePlacesPickerExample;
430 | PRODUCT_NAME = "$(TARGET_NAME)";
431 | VERSIONING_SYSTEM = "apple-generic";
432 | };
433 | name = Debug;
434 | };
435 | 97C147071CF9000F007C117D /* Release */ = {
436 | isa = XCBuildConfiguration;
437 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
438 | buildSettings = {
439 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
440 | CURRENT_PROJECT_VERSION = 1;
441 | ENABLE_BITCODE = NO;
442 | FRAMEWORK_SEARCH_PATHS = (
443 | "$(inherited)",
444 | "$(PROJECT_DIR)/Flutter",
445 | );
446 | INFOPLIST_FILE = Runner/Info.plist;
447 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
448 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
449 | LIBRARY_SEARCH_PATHS = (
450 | "$(inherited)",
451 | "$(PROJECT_DIR)/Flutter",
452 | );
453 | PRODUCT_BUNDLE_IDENTIFIER = com.theantimony.googlePlacesPickerExample;
454 | PRODUCT_NAME = "$(TARGET_NAME)";
455 | VERSIONING_SYSTEM = "apple-generic";
456 | };
457 | name = Release;
458 | };
459 | /* End XCBuildConfiguration section */
460 |
461 | /* Begin XCConfigurationList section */
462 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
463 | isa = XCConfigurationList;
464 | buildConfigurations = (
465 | 97C147031CF9000F007C117D /* Debug */,
466 | 97C147041CF9000F007C117D /* Release */,
467 | );
468 | defaultConfigurationIsVisible = 0;
469 | defaultConfigurationName = Release;
470 | };
471 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
472 | isa = XCConfigurationList;
473 | buildConfigurations = (
474 | 97C147061CF9000F007C117D /* Debug */,
475 | 97C147071CF9000F007C117D /* Release */,
476 | );
477 | defaultConfigurationIsVisible = 0;
478 | defaultConfigurationName = Release;
479 | };
480 | /* End XCConfigurationList section */
481 | };
482 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
483 | }
484 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
31 |
32 |
33 |
34 |
40 |
41 |
42 |
43 |
44 |
45 |
56 |
58 |
64 |
65 |
66 |
67 |
68 |
69 |
75 |
77 |
83 |
84 |
85 |
86 |
88 |
89 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.h:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 |
4 | @interface AppDelegate : FlutterAppDelegate
5 |
6 | @end
7 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.m:
--------------------------------------------------------------------------------
1 | #include "AppDelegate.h"
2 | #include "GeneratedPluginRegistrant.h"
3 |
4 | @implementation AppDelegate
5 |
6 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
7 | [GeneratedPluginRegistrant registerWithRegistry:self];
8 | return [super application:application didFinishLaunchingWithOptions:launchOptions];
9 | }
10 |
11 | @end
12 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | google_places_picker_example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/ios/Runner/main.m:
--------------------------------------------------------------------------------
1 | #import
2 | #import
3 | #import "AppDelegate.h"
4 |
5 | int main(int argc, char * argv[]) {
6 | @autoreleasepool {
7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:google_places_picker/google_places_picker.dart';
3 |
4 | void main() => runApp(new MyApp());
5 |
6 | class MyApp extends StatefulWidget {
7 | @override
8 | _MyAppState createState() => new _MyAppState();
9 | }
10 |
11 | class _MyAppState extends State {
12 | String _placeName = 'Unknown';
13 |
14 | @override
15 | initState() {
16 | super.initState();
17 | PluginGooglePlacePicker.initialize(
18 | androidApiKey: "YOUR_ANDROID_API_KEY",
19 | iosApiKey: "YOUR_IOS_API_KEY",
20 | );
21 | }
22 |
23 | _showAutocomplete() async {
24 | String placeName;
25 | var locationBias = LocationBias()
26 | ..northEastLat = 20.0
27 | ..northEastLng = 20.0
28 | ..southWestLat = 0.0
29 | ..southWestLng = 0.0;
30 |
31 | var locationRestriction = LocationRestriction()
32 | ..northEastLat = 20.0
33 | ..northEastLng = 20.0
34 | ..southWestLng = 0.0
35 | ..southWestLat = 0.0;
36 |
37 | var country = "US";
38 |
39 | // Platform messages may fail, so we use a try/catch PlatformException.
40 | var place = await PluginGooglePlacePicker.showAutocomplete(
41 | mode: PlaceAutocompleteMode.MODE_OVERLAY,
42 | countryCode: country,
43 | restriction: locationRestriction,
44 | typeFilter: TypeFilter.ESTABLISHMENT);
45 | placeName = place.name ?? "Null place name!";
46 |
47 | // If the widget was removed from the tree while the asynchronous platform
48 | // message was in flight, we want to discard the reply rather than calling
49 | // setState to update our non-existent appearance.
50 | if (!mounted) return;
51 |
52 | setState(() {
53 | _placeName = placeName;
54 | });
55 | }
56 |
57 | @override
58 | Widget build(BuildContext context) {
59 | return new MaterialApp(
60 | home: new Scaffold(
61 | appBar: new AppBar(
62 | title: new Text('Place picker example app'),
63 | ),
64 | body: new Center(
65 | child: new Column(
66 | children: [
67 | TextButton(
68 | onPressed: _showAutocomplete,
69 | child: new Text("Show autocomplete")),
70 | Row(
71 | children: [
72 | new Text("Place name: "),
73 | new Text(_placeName)
74 | ],
75 | )
76 | ],
77 | ),
78 | ),
79 | ),
80 | );
81 | }
82 | }
83 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: google_places_picker_example
2 | description: Demonstrates how to use the google_places_picker plugin.
3 |
4 | dependencies:
5 | flutter:
6 | sdk: flutter
7 |
8 | # The following adds the Cupertino Icons font to your application.
9 | # Use with the CupertinoIcons class for iOS style icons.
10 | cupertino_icons: ^1.0.6
11 |
12 | dev_dependencies:
13 | flutter_test:
14 | sdk: flutter
15 |
16 | google_places_picker:
17 | path: ../
18 |
19 | environment:
20 | sdk: '>=2.12.0 <4.0.0'
21 | flutter: '>=2.0.0'
22 |
23 | # For information on the generic Dart part of this file, see the
24 | # following page: https://www.dartlang.org/tools/pub/pubspec
25 |
26 | # The following section is specific to Flutter.
27 | flutter:
28 |
29 | # The following line ensures that the Material Icons font is
30 | # included with your application, so that you can use the icons in
31 | # the material Icons class.
32 | uses-material-design: true
33 |
34 | # To add assets to your application, add an assets section, like this:
35 | # assets:
36 | # - images/a_dot_burr.jpeg
37 | # - images/a_dot_ham.jpeg
38 |
39 | # An image asset can refer to one or more resolution-specific "variants", see
40 | # https://flutter.io/assets-and-images/#resolution-aware.
41 |
42 | # For details regarding adding assets from package dependencies, see
43 | # https://flutter.io/assets-and-images/#from-packages
44 |
45 | # To add custom fonts to your application, add a fonts section here,
46 | # in this "flutter" section. Each entry in this list should have a
47 | # "family" key with the font family name, and a "fonts" key with a
48 | # list giving the asset and other descriptors for the font. For
49 | # example:
50 | # fonts:
51 | # - family: Schyler
52 | # fonts:
53 | # - asset: fonts/Schyler-Regular.ttf
54 | # - asset: fonts/Schyler-Italic.ttf
55 | # style: italic
56 | # - family: Trajan Pro
57 | # fonts:
58 | # - asset: fonts/TrajanPro.ttf
59 | # - asset: fonts/TrajanPro_Bold.ttf
60 | # weight: 700
61 | #
62 | # For details regarding fonts from package dependencies,
63 | # see https://flutter.io/custom-fonts/#from-packages
64 |
--------------------------------------------------------------------------------
/google_places_picker.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/google_places_picker_android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 |
--------------------------------------------------------------------------------
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/derTuca/flutter_google_places_picker/03cc9bdb3f75fb6315a8851b817841a34645aa35/ios/Assets/.gitkeep
--------------------------------------------------------------------------------
/ios/Classes/GooglePlacesPickerPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 | @import GooglePlaces;
3 |
4 | @interface GooglePlacesPickerPlugin : NSObject
5 | @end
6 |
--------------------------------------------------------------------------------
/ios/Classes/GooglePlacesPickerPlugin.m:
--------------------------------------------------------------------------------
1 | #import "GooglePlacesPickerPlugin.h"
2 | @import GooglePlaces;
3 |
4 | @implementation GooglePlacesPickerPlugin
5 | FlutterResult _result;
6 | UIViewController *vc;
7 | NSDictionary *filterTypes;
8 |
9 | + (void)registerWithRegistrar:(NSObject*)registrar {
10 | filterTypes = @{
11 | @"address": [NSNumber numberWithInt:kGMSPlacesAutocompleteTypeFilterAddress],
12 | @"cities": [NSNumber numberWithInt:kGMSPlacesAutocompleteTypeFilterCity],
13 | @"region": [NSNumber numberWithInt:kGMSPlacesAutocompleteTypeFilterRegion],
14 | @"geocode": [NSNumber numberWithInt:kGMSPlacesAutocompleteTypeFilterGeocode],
15 | @"establishment": [NSNumber numberWithInt:kGMSPlacesAutocompleteTypeFilterEstablishment]
16 | };
17 |
18 | vc = [UIApplication sharedApplication].delegate.window.rootViewController;
19 | FlutterMethodChannel* channel = [FlutterMethodChannel
20 | methodChannelWithName:@"plugin_google_place_picker"
21 | binaryMessenger:[registrar messenger]];
22 | GooglePlacesPickerPlugin* instance = [[GooglePlacesPickerPlugin alloc] init];
23 | [registrar addMethodCallDelegate:instance channel:channel];
24 | }
25 |
26 | - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
27 | _result = result;
28 | if ([@"showAutocomplete" isEqualToString:call.method]) {
29 | [self showAutocomplete:call.arguments[@"type"]
30 | bounds:call.arguments[@"bounds"]
31 | restriction:call.arguments[@"restriction"]
32 | country:call.arguments[@"country"]];
33 | } else if ([@"initialize" isEqualToString:call.method]) {
34 | [self initialize:call.arguments[@"iosApiKey"]];
35 | } else {
36 | result(FlutterMethodNotImplemented);
37 | }
38 | }
39 |
40 | -(void)initialize:(NSString *)apiKey {
41 | if ([apiKey length] == 0) {
42 | FlutterError *fError = [FlutterError errorWithCode:@"API_KEY_ERROR" message:@"Invalid iOS API Key" details:nil];
43 | _result(fError);
44 | }
45 | [GMSPlacesClient provideAPIKey:apiKey];
46 | _result(nil);
47 | }
48 |
49 | -(void)showAutocomplete:(NSString *)filter bounds:(NSDictionary *)boundsDictionary restriction:(NSDictionary *)restriction country:(NSString *)country {
50 |
51 | GMSAutocompleteViewController *autocompleteController = [[GMSAutocompleteViewController alloc] init];
52 | if (@available(iOS 12.0, *)) {
53 | // Prevent white text on white screen
54 | if ([[[UIScreen mainScreen] traitCollection] userInterfaceStyle] == UIUserInterfaceStyleDark) {
55 | autocompleteController.primaryTextColor = UIColor.whiteColor;
56 | autocompleteController.secondaryTextColor = UIColor.lightGrayColor;
57 | autocompleteController.tableCellSeparatorColor = UIColor.lightGrayColor;
58 | autocompleteController.tableCellBackgroundColor = UIColor.darkGrayColor;
59 | } else {
60 | autocompleteController.primaryTextColor = UIColor.blackColor;
61 | autocompleteController.secondaryTextColor = UIColor.lightGrayColor;
62 | autocompleteController.tableCellSeparatorColor = UIColor.lightGrayColor;
63 | autocompleteController.tableCellBackgroundColor = UIColor.whiteColor;
64 | }
65 | }
66 |
67 | GMSAutocompleteFilter *autocompleteFilter = [[GMSAutocompleteFilter alloc] init];
68 | autocompleteController.autocompleteFilter = autocompleteFilter;
69 |
70 |
71 | if (![filter isEqual:[NSNull null]] || ![country isEqual:[NSNull null]]) {
72 | if (![filter isEqual:[NSNull null]]) {
73 | autocompleteFilter.type = [filterTypes[filter] intValue];
74 | } else {
75 | autocompleteFilter.type = kGMSPlacesAutocompleteTypeFilterNoFilter;
76 | }
77 |
78 | if (![country isEqual:[NSNull null]]) {
79 | autocompleteFilter.country = country;
80 | }
81 |
82 |
83 | }
84 |
85 | if (![boundsDictionary isEqual:[NSNull null]] || ![restriction isEqual:[NSNull null]]) {
86 |
87 | if (![restriction isEqual:[NSNull null]]) {
88 | double neLat = [restriction[@"northEastLat"] doubleValue];
89 | double neLng = [restriction[@"northEastLng"] doubleValue];
90 | double swLat = [restriction[@"southWestLat"] doubleValue];
91 | double swLng = [restriction[@"southWestLng"] doubleValue];
92 |
93 | CLLocationCoordinate2D neCoordinate = CLLocationCoordinate2DMake(neLat, neLng);
94 | CLLocationCoordinate2D swCoordinate = CLLocationCoordinate2DMake(swLat, swLng);
95 |
96 | autocompleteFilter.locationRestriction = GMSPlaceRectangularLocationOption(neCoordinate, swCoordinate);
97 |
98 | } else {
99 | double neLat = [boundsDictionary[@"northEastLat"] doubleValue];
100 | double neLng = [boundsDictionary[@"northEastLng"] doubleValue];
101 | double swLat = [boundsDictionary[@"southWestLat"] doubleValue];
102 | double swLng = [boundsDictionary[@"southWestLng"] doubleValue];
103 |
104 | CLLocationCoordinate2D neCoordinate = CLLocationCoordinate2DMake(neLat, neLng);
105 | CLLocationCoordinate2D swCoordinate = CLLocationCoordinate2DMake(swLat, swLng);
106 |
107 | autocompleteFilter.locationBias = GMSPlaceRectangularLocationOption(neCoordinate, swCoordinate);
108 | }
109 |
110 | }
111 |
112 | autocompleteController.delegate = self;
113 | UIViewController *vc = [UIApplication sharedApplication].delegate.window.rootViewController;
114 | [vc presentViewController:autocompleteController animated:YES completion:nil];
115 |
116 | }
117 |
118 | - (void)viewController:(nonnull GMSAutocompleteViewController *)viewController didAutocompleteWithPlace:(nonnull GMSPlace *)place {
119 | [vc dismissViewControllerAnimated:YES completion:nil];
120 | NSDictionary *placeMap = @{
121 | @"name" : place.name,
122 | @"latitude" : [NSString stringWithFormat:@"%.7f", place.coordinate.latitude],
123 | @"longitude" : [NSString stringWithFormat:@"%.7f", place.coordinate.longitude],
124 | @"id" : place.placeID,
125 | };
126 | NSMutableDictionary *mutablePlaceMap = placeMap.mutableCopy;
127 | if (place.formattedAddress != nil) {
128 | mutablePlaceMap[@"address"] = place.formattedAddress;
129 | }
130 | _result(mutablePlaceMap);
131 | }
132 |
133 | - (void)viewController:(nonnull GMSAutocompleteViewController *)viewController didFailAutocompleteWithError:(nonnull NSError *)error {
134 | [vc dismissViewControllerAnimated:YES completion:nil];
135 | FlutterError *fError = [FlutterError errorWithCode:@"PLACE_AUTOCOMPLETE_ERROR" message:error.localizedDescription details:nil];
136 |
137 | _result(fError);
138 | }
139 |
140 | - (void)wasCancelled:(nonnull GMSAutocompleteViewController *)viewController {
141 | [vc dismissViewControllerAnimated:YES completion:nil];
142 | FlutterError *fError = [FlutterError errorWithCode:@"USER_CANCELED" message:@"User has canceled the operation." details:nil];
143 | _result(fError);
144 | }
145 |
146 | - (void)didRequestAutocompletePredictions:(GMSAutocompleteViewController *)viewController {
147 | [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
148 | }
149 |
150 | - (void)didUpdateAutocompletePredictions:(GMSAutocompleteViewController *)viewController {
151 | [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
152 | }
153 |
154 | @end
155 |
--------------------------------------------------------------------------------
/ios/google_places_picker.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
3 | #
4 | Pod::Spec.new do |s|
5 | s.name = 'google_places_picker'
6 | s.version = '0.0.3'
7 | s.summary = 'Flutter plugin for Google Places and Autocomplete'
8 | s.description = <<-DESC
9 | Flutter plugin for Google Places Autocomplete
10 | DESC
11 | s.homepage = 'https://github.com/derTuca/flutter_google_places_picker'
12 | s.license = { :file => '../LICENSE' }
13 | s.author = { 'Alexandru Tuca' => 'salexandru.tuca@outlook.com' }
14 | s.source = { :path => '.' }
15 | s.source_files = 'Classes/**/*'
16 | s.public_header_files = 'Classes/**/*.h'
17 | s.dependency 'Flutter'
18 | s.dependency 'GooglePlaces', '~> 4.0'
19 | s.static_framework = true
20 | s.ios.deployment_target = '9.0'
21 | end
22 |
23 |
--------------------------------------------------------------------------------
/lib/google_places_picker.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/services.dart';
4 |
5 | class Place {
6 | late double latitude;
7 | late double longitude;
8 | late String id;
9 | String? name;
10 | String? address;
11 | }
12 |
13 | enum PlaceAutocompleteMode { MODE_OVERLAY, MODE_FULLSCREEN }
14 |
15 | enum TypeFilter { ADDRESS, CITIES, ESTABLISHMENT, GEOCODE, REGIONS }
16 |
17 | class LocationBias {
18 | double northEastLat = 90.0;
19 | double northEastLng = 180.0;
20 | double southWestLat = 0.0;
21 | double southWestLng = 0.0;
22 | }
23 |
24 | class LocationRestriction {
25 | double northEastLat = 90.0;
26 | double northEastLng = 180.0;
27 | double southWestLat = 0.0;
28 | double southWestLng = 0.0;
29 | }
30 |
31 | class PluginGooglePlacePicker {
32 | static const MethodChannel _channel =
33 | const MethodChannel('plugin_google_place_picker');
34 |
35 | static Future showAutocomplete({
36 | required PlaceAutocompleteMode mode,
37 | LocationBias? bias,
38 | LocationRestriction? restriction,
39 | TypeFilter? typeFilter,
40 | String? countryCode,
41 | }) async {
42 | var argMap = {
43 | "mode": mode == PlaceAutocompleteMode.MODE_OVERLAY ? 71 : 72,
44 | "bias": _convertLocationBiasToMap(bias),
45 | "restriction": _convertLocationRestrictionToMap(restriction),
46 | "type": _convertFilterTypeToString(typeFilter),
47 | "country": countryCode
48 | };
49 | final Map placeMap =
50 | await (_channel.invokeMethod('showAutocomplete', argMap));
51 | return _initPlaceFromMap(placeMap);
52 | }
53 |
54 | static Future initialize(
55 | {String? androidApiKey, String? iosApiKey}) async {
56 | await _channel.invokeMethod(
57 | 'initialize', {"androidApiKey": androidApiKey, "iosApiKey": iosApiKey});
58 | }
59 |
60 | static Place _initPlaceFromMap(Map placeMap) {
61 | if (placeMap["latitude"] is double) {
62 | return new Place()
63 | ..name = placeMap["name"]
64 | ..id = placeMap["id"]
65 | ..address = placeMap["address"]
66 | ..latitude = placeMap["latitude"]
67 | ..longitude = placeMap["longitude"];
68 | } else {
69 | return new Place()
70 | ..name = placeMap["name"]
71 | ..id = placeMap["id"]
72 | ..address = placeMap["address"]
73 | ..latitude = double.parse(placeMap["latitude"])
74 | ..longitude = double.parse(placeMap["longitude"]);
75 | }
76 | }
77 |
78 | static String? _convertFilterTypeToString(TypeFilter? type) {
79 | if (type == null) {
80 | return null;
81 | }
82 | switch (type) {
83 | case TypeFilter.ADDRESS:
84 | return "address";
85 | case TypeFilter.CITIES:
86 | return "cities";
87 | case TypeFilter.ESTABLISHMENT:
88 | return "establishment";
89 | case TypeFilter.GEOCODE:
90 | return "geocode";
91 | case TypeFilter.REGIONS:
92 | return "regions";
93 | }
94 | }
95 |
96 | static Map? _convertLocationBiasToMap(LocationBias? bias) {
97 | if (bias == null) {
98 | return null;
99 | }
100 | return {
101 | "southWestLat": bias.southWestLat,
102 | "southWestLng": bias.southWestLng,
103 | "northEastLat": bias.northEastLat,
104 | "northEastLng": bias.northEastLng
105 | };
106 | }
107 |
108 | static Map? _convertLocationRestrictionToMap(
109 | LocationRestriction? restriction) {
110 | if (restriction == null) {
111 | return null;
112 | }
113 | return {
114 | "southWestLat": restriction.southWestLat,
115 | "southWestLng": restriction.southWestLng,
116 | "northEastLat": restriction.northEastLat,
117 | "northEastLng": restriction.northEastLng
118 | };
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: google_places_picker
2 | description: Flutter plugin for Google Places and Autocomplete.
3 | version: 3.0.2
4 | homepage: https://github.com/derTuca/flutter_google_places_picker
5 |
6 | dependencies:
7 | flutter:
8 | sdk: flutter
9 |
10 | # For information on the generic Dart part of this file, see the
11 | # following page: https://www.dartlang.org/tools/pub/pubspec
12 | environment:
13 | sdk: '>=2.12.0 <4.0.0'
14 | flutter: '>=2.0.0'
15 | # The following section is specific to Flutter.
16 | flutter:
17 | plugin:
18 | platforms:
19 | android:
20 | package: com.theantimony.googleplacespicker
21 | pluginClass: GooglePlacesPickerPlugin
22 | ios:
23 | pluginClass: GooglePlacesPickerPlugin
24 | # To add assets to your plugin package, add an assets section, like this:
25 | # assets:
26 | # - images/a_dot_burr.jpeg
27 | # - images/a_dot_ham.jpeg
28 | #
29 | # For details regarding assets in packages, see
30 | # https://flutter.io/assets-and-images/#from-packages
31 | #
32 | # An image asset can refer to one or more resolution-specific "variants", see
33 | # https://flutter.io/assets-and-images/#resolution-aware.
34 | # To add custom fonts to your plugin package, add a fonts section here,
35 | # in this "flutter" section. Each entry in this list should have a
36 | # "family" key with the font family name, and a "fonts" key with a
37 | # list giving the asset and other descriptors for the font. For
38 | # example:
39 | # fonts:
40 | # - family: Schyler
41 | # fonts:
42 | # - asset: fonts/Schyler-Regular.ttf
43 | # - asset: fonts/Schyler-Italic.ttf
44 | # style: italic
45 | # - family: Trajan Pro
46 | # fonts:
47 | # - asset: fonts/TrajanPro.ttf
48 | # - asset: fonts/TrajanPro_Bold.ttf
49 | # weight: 700
50 | #
51 | # For details regarding fonts in packages, see
52 | # https://flutter.io/custom-fonts/#from-packages
53 |
--------------------------------------------------------------------------------
/res/values/strings_en.arb:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------