├── .gitattributes ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── googlemapplacepicker │ │ │ │ │ └── example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── 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-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── WorkspaceSettings.xcsettings │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── 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 │ │ └── Runner-Bridging-Header.h ├── lib │ └── main.dart ├── linux │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ ├── main.cc │ ├── my_application.cc │ └── my_application.h ├── macos │ ├── .gitignore │ ├── Flutter │ │ ├── Flutter-Debug.xcconfig │ │ ├── Flutter-Release.xcconfig │ │ └── GeneratedPluginRegistrant.swift │ ├── Podfile │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── app_icon_1024.png │ │ │ ├── app_icon_128.png │ │ │ ├── app_icon_16.png │ │ │ ├── app_icon_256.png │ │ │ ├── app_icon_32.png │ │ │ ├── app_icon_512.png │ │ │ └── app_icon_64.png │ │ ├── Base.lproj │ │ └── MainMenu.xib │ │ ├── Configs │ │ ├── AppInfo.xcconfig │ │ ├── Debug.xcconfig │ │ ├── Release.xcconfig │ │ └── Warnings.xcconfig │ │ ├── DebugProfile.entitlements │ │ ├── Info.plist │ │ ├── MainFlutterWindow.swift │ │ └── Release.entitlements ├── pubspec.lock ├── pubspec.yaml ├── test │ └── widget_test.dart ├── web │ ├── favicon.png │ ├── icons │ │ ├── Icon-192.png │ │ ├── Icon-512.png │ │ ├── Icon-maskable-192.png │ │ └── Icon-maskable-512.png │ ├── index.html │ └── manifest.json └── windows │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter │ ├── CMakeLists.txt │ ├── generated_plugin_registrant.cc │ ├── generated_plugin_registrant.h │ └── generated_plugins.cmake │ └── runner │ ├── CMakeLists.txt │ ├── Runner.rc │ ├── flutter_window.cpp │ ├── flutter_window.h │ ├── main.cpp │ ├── resource.h │ ├── resources │ └── app_icon.ico │ ├── runner.exe.manifest │ ├── utils.cpp │ ├── utils.h │ ├── win32_window.cpp │ └── win32_window.h ├── lib ├── flutter_place_picker.dart ├── models │ ├── local_prediction.dart │ └── pick_result.dart ├── providers │ ├── autocomplete_search_controller.dart │ ├── place_provider.dart │ └── search_provider.dart ├── resources │ ├── get_from_server.dart │ └── post_to_server.dart ├── src │ ├── autocomplete_search.dart │ ├── flutter_place_picker.dart │ └── picker.dart ├── utils │ ├── urls.dart │ └── uuid.dart └── widgets │ ├── animated_pin.dart │ ├── floating_card.dart │ ├── prediction_tile.dart │ └── rounded_frame.dart ├── preview.gif ├── pubspec.lock ├── pubspec.yaml ├── screenshot2.png └── test └── flutter_place_picker_test.dart /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | build/ 32 | 33 | # Android related 34 | **/android/**/gradle-wrapper.jar 35 | **/android/.gradle 36 | **/android/captures/ 37 | **/android/gradlew 38 | **/android/gradlew.bat 39 | **/android/local.properties 40 | **/android/**/GeneratedPluginRegistrant.java 41 | 42 | # iOS/XCode related 43 | **/ios/**/*.mode1v3 44 | **/ios/**/*.mode2v3 45 | **/ios/**/*.moved-aside 46 | **/ios/**/*.pbxuser 47 | **/ios/**/*.perspectivev3 48 | **/ios/**/*sync/ 49 | **/ios/**/.sconsign.dblite 50 | **/ios/**/.tags* 51 | **/ios/**/.vagrant/ 52 | **/ios/**/DerivedData/ 53 | **/ios/**/Icon? 54 | **/ios/**/Pods/ 55 | **/ios/**/.symlinks/ 56 | **/ios/**/profile 57 | **/ios/**/xcuserdata 58 | **/ios/.generated/ 59 | **/ios/Flutter/App.framework 60 | **/ios/Flutter/Flutter.framework 61 | **/ios/Flutter/Flutter.podspec 62 | **/ios/Flutter/Generated.xcconfig 63 | **/ios/Flutter/app.flx 64 | **/ios/Flutter/app.zip 65 | **/ios/Flutter/flutter_assets/ 66 | **/ios/Flutter/flutter_export_environment.sh 67 | **/ios/ServiceDefinitions.json 68 | **/ios/Runner/GeneratedPluginRegistrant.* 69 | 70 | # Exceptions to above rules. 71 | !**/ios/**/default.mode1v3 72 | !**/ios/**/default.mode2v3 73 | !**/ios/**/default.pbxuser 74 | !**/ios/**/default.perspectivev3 75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 76 | # example/android/app/src/main/AndroidManifest.xml 77 | test/google_maps_place_picker_test.dart -------------------------------------------------------------------------------- /.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: 27321ebbad34b0a3fafe99fac037102196d655ff 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.0.1-dev.5] - 03/March/2023 2 | - Dependencies update 3 | - Clean ups documentation 4 | 5 | ## [0.0.1-dev.4] - 24/Aug/2022 6 | - ReadMe update 7 | - Placemark(geocoding) added to get current location address without internet connectivity 8 | - Code documentation 9 | 10 | ## [0.0.1-dev.3] - 19/Aug/2022 11 | - ReadMe update 12 | - Server url made optional 13 | 14 | ## [0.0.1-dev.2] - 17/Aug/2022 15 | - ReadMe update 16 | 17 | ## [0.0.1-dev.1] 18 | - Initial release 19 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at terry@gixgames.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 saytoonz09 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. 22 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | 39 | # API Key related 40 | /lib/keys.dart 41 | /android/app/src/main/AndroidManifest.xml -------------------------------------------------------------------------------- /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. 5 | 6 | version: 7 | revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 8 | channel: stable 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 17 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 18 | - platform: android 19 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 20 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 21 | - platform: ios 22 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 23 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 24 | - platform: linux 25 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 26 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 27 | - platform: macos 28 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 29 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 30 | - platform: web 31 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 32 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 33 | - platform: windows 34 | create_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 35 | base_revision: 12cb4eb7a009f52b347b62ade7cb4854b926af72 36 | 37 | # User provided section 38 | 39 | # List of Local paths (relative to this file) that should be 40 | # ignored by the migrate tool. 41 | # 42 | # Files that are not part of the templates will be ignored by default. 43 | unmanaged_files: 44 | - 'lib/main.dart' 45 | - 'ios/Runner.xcodeproj/project.pbxproj' 46 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # Example 2 | 3 | Example project of Google Maps Place Picker 4 | 5 | -------------------------------------------------------------------------------- /example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /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 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply plugin: 'kotlin-android' 26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 27 | 28 | android { 29 | compileSdkVersion flutter.compileSdkVersion 30 | ndkVersion flutter.ndkVersion 31 | 32 | compileOptions { 33 | sourceCompatibility JavaVersion.VERSION_1_8 34 | targetCompatibility JavaVersion.VERSION_1_8 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = '1.8' 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += 'src/main/kotlin' 43 | } 44 | 45 | defaultConfig { 46 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 47 | applicationId "com.example.googlemapplacepicker.example" 48 | // You can update the following values to match your application needs. 49 | // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration. 50 | minSdkVersion flutter.minSdkVersion 51 | targetSdkVersion flutter.targetSdkVersion 52 | versionCode flutterVersionCode.toInteger() 53 | versionName flutterVersionName 54 | } 55 | 56 | buildTypes { 57 | release { 58 | // TODO: Add your own signing config for the release build. 59 | // Signing with the debug keys for now, so `flutter run --release` works. 60 | signingConfig signingConfigs.debug 61 | } 62 | } 63 | } 64 | 65 | flutter { 66 | source '../..' 67 | } 68 | 69 | dependencies { 70 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 71 | } 72 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/googlemapplacepicker/example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.googlemapplacepicker.example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.7.10' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.2.0' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | } 12 | } 13 | 14 | allprojects { 15 | repositories { 16 | google() 17 | mavenCentral() 18 | } 19 | } 20 | 21 | rootProject.buildDir = '../build' 22 | subprojects { 23 | project.buildDir = "${rootProject.buildDir}/${project.name}" 24 | } 25 | subprojects { 26 | project.evaluationDependsOn(':app') 27 | } 28 | 29 | task clean(type: Delete) { 30 | delete rootProject.buildDir 31 | } 32 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip 6 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties") 4 | def properties = new Properties() 5 | 6 | assert localPropertiesFile.exists() 7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } 8 | 9 | def flutterSdkPath = properties.getProperty("flutter.sdk") 10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" 12 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | 11.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/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, '11.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 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - geocoding_ios (1.0.5): 4 | - Flutter 5 | - geolocator_apple (1.2.0): 6 | - Flutter 7 | - google_maps_flutter_ios (0.0.1): 8 | - Flutter 9 | - GoogleMaps 10 | - GoogleMaps (5.2.0): 11 | - GoogleMaps/Maps (= 5.2.0) 12 | - GoogleMaps/Base (5.2.0) 13 | - GoogleMaps/Maps (5.2.0): 14 | - GoogleMaps/Base 15 | - package_info_plus (0.4.5): 16 | - Flutter 17 | - permission_handler_apple (9.0.4): 18 | - Flutter 19 | 20 | DEPENDENCIES: 21 | - Flutter (from `Flutter`) 22 | - geocoding_ios (from `.symlinks/plugins/geocoding_ios/ios`) 23 | - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) 24 | - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) 25 | - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) 26 | - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) 27 | 28 | SPEC REPOS: 29 | trunk: 30 | - GoogleMaps 31 | 32 | EXTERNAL SOURCES: 33 | Flutter: 34 | :path: Flutter 35 | geocoding_ios: 36 | :path: ".symlinks/plugins/geocoding_ios/ios" 37 | geolocator_apple: 38 | :path: ".symlinks/plugins/geolocator_apple/ios" 39 | google_maps_flutter_ios: 40 | :path: ".symlinks/plugins/google_maps_flutter_ios/ios" 41 | package_info_plus: 42 | :path: ".symlinks/plugins/package_info_plus/ios" 43 | permission_handler_apple: 44 | :path: ".symlinks/plugins/permission_handler_apple/ios" 45 | 46 | SPEC CHECKSUMS: 47 | Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 48 | geocoding_ios: a389ea40f6f548de6e63006a2e31bf66ff80769a 49 | geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 50 | google_maps_flutter_ios: 66201f392bf62d500f07670a30488a247b9bb5b9 51 | GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693 52 | package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e 53 | permission_handler_apple: 44366e37eaf29454a1e7b1b7d736c2cceaeb17ce 54 | 55 | PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 56 | 57 | COCOAPODS: 1.11.3 58 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /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.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | import GoogleMaps 4 | 5 | @UIApplicationMain 6 | @objc class AppDelegate: FlutterAppDelegate { 7 | override func application( 8 | _ application: UIApplication, 9 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 10 | ) -> Bool { 11 | GMSServices.provideAPIKey("YOUR KEY HERE") 12 | GeneratedPluginRegistrant.register(with: self) 13 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 14 | } 15 | } -------------------------------------------------------------------------------- /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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/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 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 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 | NSLocationWhenInUseUsageDescription 46 | This app needs your location to test the location feature of the Google Maps location picker plugin. 47 | NSLocationAlwaysUsageDescription 48 | This app needs access to location when in the background. 49 | NSLocationAlwaysAndWhenInUseUsageDescription 50 | This app needs access to location when open and in the background. 51 | 52 | io.flutter.embedded_views_preview 53 | 54 | CADisableMinimumFrameDurationOnPhone 55 | 56 | UIApplicationSupportsIndirectInputEvents 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_maps_flutter/google_maps_flutter.dart'; 3 | import 'package:flutter_place_picker/flutter_place_picker.dart'; 4 | 5 | // Your api key storage. 6 | 7 | void main() => runApp(MyApp()); 8 | 9 | class MyApp extends StatelessWidget { 10 | // Light Theme 11 | final ThemeData lightTheme = ThemeData.light().copyWith( 12 | // Background color of the FloatingCard 13 | cardColor: Colors.white, 14 | buttonTheme: const ButtonThemeData( 15 | // Select here's button color 16 | buttonColor: Colors.black, 17 | textTheme: ButtonTextTheme.primary, 18 | ), 19 | ); 20 | 21 | // Dark Theme 22 | final ThemeData darkTheme = ThemeData.dark().copyWith( 23 | // Background color of the FloatingCard 24 | cardColor: Colors.grey, 25 | buttonTheme: const ButtonThemeData( 26 | // Select here's button color 27 | buttonColor: Colors.yellow, 28 | textTheme: ButtonTextTheme.primary, 29 | ), 30 | ); 31 | 32 | MyApp({Key? key}) : super(key: key); 33 | 34 | // This widget is the root of your application. 35 | @override 36 | Widget build(BuildContext context) { 37 | return MaterialApp( 38 | title: 'Flutter Place Picker Demo', 39 | theme: lightTheme, 40 | darkTheme: darkTheme, 41 | themeMode: ThemeMode.light, 42 | home: const HomePage(), 43 | debugShowCheckedModeBanner: false, 44 | ); 45 | } 46 | } 47 | 48 | class HomePage extends StatefulWidget { 49 | const HomePage({Key? key}) : super(key: key); 50 | 51 | @override 52 | State createState() => _HomePageState(); 53 | } 54 | 55 | class _HomePageState extends State { 56 | PickResult? selectedPlace; 57 | 58 | final LatLng kInitialPosition = const LatLng(-33.8567844, 151.213108); 59 | 60 | @override 61 | Widget build(BuildContext context) { 62 | return Scaffold( 63 | appBar: AppBar( 64 | title: const Text("Google Map Place Picker Demo"), 65 | ), 66 | body: Center( 67 | child: Column( 68 | mainAxisAlignment: MainAxisAlignment.center, 69 | crossAxisAlignment: CrossAxisAlignment.center, 70 | children: [ 71 | ElevatedButton( 72 | child: const Text("Load Google Map"), 73 | onPressed: () { 74 | Navigator.push( 75 | context, 76 | MaterialPageRoute( 77 | builder: (context) { 78 | return FlutterPlacePicker( 79 | apiKey: 80 | "YOUR KEY HERE", // Needed to display google maps and 81 | initialPosition: kInitialPosition, 82 | useCurrentLocation: true, 83 | selectInitialPosition: true, 84 | usePlaceDetailSearch: false, 85 | region: 'gh', 86 | strictBounds: true, 87 | onPlacePicked: (result) { 88 | selectedPlace = result; 89 | 90 | print(result.geometry!.location.lat); 91 | print(result.geometry!.location.lng); 92 | print(result.placeId); 93 | print(result.formattedAddress); 94 | 95 | Navigator.of(context).pop(); 96 | setState(() {}); 97 | }, 98 | // serverUrl: "https://www.your-server.com/api/", 99 | //automaticallyImplyAppBarLeading: false, 100 | // selectedPlaceWidgetBuilder: (_, selectedPlace, state, isSearchBarFocused) { 101 | // print("state: $state, isSearchBarFocused: $isSearchBarFocused"); 102 | // return isSearchBarFocused 103 | // ? Container() 104 | // : FloatingCard( 105 | // bottomPosition: 0.0, // MediaQuery.of(context) will cause rebuild. See MediaQuery document for the information. 106 | // leftPosition: 0.0, 107 | // rightPosition: 0.0, 108 | // width: 500, 109 | // borderRadius: BorderRadius.circular(12.0), 110 | // child: state == SearchingState.Searching 111 | // ? Center(child: CircularProgressIndicator()) 112 | // : RaisedButton( 113 | // child: Text("Pick Here"), 114 | // onPressed: () { 115 | // // IMPORTANT: You MUST manage selectedPlace data yourself as using this build will not invoke onPlacePicker as 116 | // // this will override default 'Select here' Button. 117 | // print("do something with [selectedPlace] data"); 118 | // Navigator.of(context).pop(); 119 | // }, 120 | // ), 121 | // ); 122 | // }, 123 | // pinBuilder: (context, state) { 124 | // if (state == PinState.Idle) { 125 | // return Icon(Icons.favorite_border); 126 | // } else { 127 | // return Icon(Icons.favorite); 128 | // } 129 | // }, 130 | ); 131 | }, 132 | ), 133 | ); 134 | }, 135 | ), 136 | selectedPlace == null 137 | ? Container() 138 | : Text(selectedPlace!.formattedAddress ?? ""), 139 | ], 140 | ), 141 | )); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /example/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.10) 3 | project(runner LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "example") 8 | # The unique GTK application identifier for this application. See: 9 | # https://wiki.gnome.org/HowDoI/ChooseApplicationID 10 | set(APPLICATION_ID "com.example.googlemapplacepicker.example") 11 | 12 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 13 | # versions of CMake. 14 | cmake_policy(SET CMP0063 NEW) 15 | 16 | # Load bundled libraries from the lib/ directory relative to the binary. 17 | set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") 18 | 19 | # Root filesystem for cross-building. 20 | if(FLUTTER_TARGET_PLATFORM_SYSROOT) 21 | set(CMAKE_SYSROOT ${FLUTTER_TARGET_PLATFORM_SYSROOT}) 22 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_SYSROOT}) 23 | set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 24 | set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) 25 | set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 26 | set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 27 | endif() 28 | 29 | # Define build configuration options. 30 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 31 | set(CMAKE_BUILD_TYPE "Debug" CACHE 32 | STRING "Flutter build mode" FORCE) 33 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 34 | "Debug" "Profile" "Release") 35 | endif() 36 | 37 | # Compilation settings that should be applied to most targets. 38 | # 39 | # Be cautious about adding new options here, as plugins use this function by 40 | # default. In most cases, you should add new options to specific targets instead 41 | # of modifying this function. 42 | function(APPLY_STANDARD_SETTINGS TARGET) 43 | target_compile_features(${TARGET} PUBLIC cxx_std_14) 44 | target_compile_options(${TARGET} PRIVATE -Wall -Werror) 45 | target_compile_options(${TARGET} PRIVATE "$<$>:-O3>") 46 | target_compile_definitions(${TARGET} PRIVATE "$<$>:NDEBUG>") 47 | endfunction() 48 | 49 | # Flutter library and tool build rules. 50 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 51 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 52 | 53 | # System-level dependencies. 54 | find_package(PkgConfig REQUIRED) 55 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 56 | 57 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 58 | 59 | # Define the application target. To change its name, change BINARY_NAME above, 60 | # not the value here, or `flutter run` will no longer work. 61 | # 62 | # Any new source files that you add to the application should be added here. 63 | add_executable(${BINARY_NAME} 64 | "main.cc" 65 | "my_application.cc" 66 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 67 | ) 68 | 69 | # Apply the standard set of build settings. This can be removed for applications 70 | # that need different build settings. 71 | apply_standard_settings(${BINARY_NAME}) 72 | 73 | # Add dependency libraries. Add any application-specific dependencies here. 74 | target_link_libraries(${BINARY_NAME} PRIVATE flutter) 75 | target_link_libraries(${BINARY_NAME} PRIVATE PkgConfig::GTK) 76 | 77 | # Run the Flutter tool portions of the build. This must not be removed. 78 | add_dependencies(${BINARY_NAME} flutter_assemble) 79 | 80 | # Only the install-generated bundle's copy of the executable will launch 81 | # correctly, since the resources must in the right relative locations. To avoid 82 | # people trying to run the unbundled copy, put it in a subdirectory instead of 83 | # the default top-level location. 84 | set_target_properties(${BINARY_NAME} 85 | PROPERTIES 86 | RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/intermediates_do_not_run" 87 | ) 88 | 89 | # Generated plugin build rules, which manage building the plugins and adding 90 | # them to the application. 91 | include(flutter/generated_plugins.cmake) 92 | 93 | 94 | # === Installation === 95 | # By default, "installing" just makes a relocatable bundle in the build 96 | # directory. 97 | set(BUILD_BUNDLE_DIR "${PROJECT_BINARY_DIR}/bundle") 98 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 99 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 100 | endif() 101 | 102 | # Start with a clean build bundle directory every time. 103 | install(CODE " 104 | file(REMOVE_RECURSE \"${BUILD_BUNDLE_DIR}/\") 105 | " COMPONENT Runtime) 106 | 107 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 108 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib") 109 | 110 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 111 | COMPONENT Runtime) 112 | 113 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 114 | COMPONENT Runtime) 115 | 116 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 117 | COMPONENT Runtime) 118 | 119 | foreach(bundled_library ${PLUGIN_BUNDLED_LIBRARIES}) 120 | install(FILES "${bundled_library}" 121 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 122 | COMPONENT Runtime) 123 | endforeach(bundled_library) 124 | 125 | # Fully re-copy the assets directory on each build to avoid having stale files 126 | # from a previous install. 127 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 128 | install(CODE " 129 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 130 | " COMPONENT Runtime) 131 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 132 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 133 | 134 | # Install the AOT library on non-Debug builds only. 135 | if(NOT CMAKE_BUILD_TYPE MATCHES "Debug") 136 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 137 | COMPONENT Runtime) 138 | endif() 139 | -------------------------------------------------------------------------------- /example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.10) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | 12 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 13 | # which isn't available in 3.10. 14 | function(list_prepend LIST_NAME PREFIX) 15 | set(NEW_LIST "") 16 | foreach(element ${${LIST_NAME}}) 17 | list(APPEND NEW_LIST "${PREFIX}${element}") 18 | endforeach(element) 19 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 20 | endfunction() 21 | 22 | # === Flutter Library === 23 | # System-level dependencies. 24 | find_package(PkgConfig REQUIRED) 25 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 26 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 27 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 28 | 29 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 30 | 31 | # Published to parent scope for install step. 32 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 33 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 34 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 35 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 36 | 37 | list(APPEND FLUTTER_LIBRARY_HEADERS 38 | "fl_basic_message_channel.h" 39 | "fl_binary_codec.h" 40 | "fl_binary_messenger.h" 41 | "fl_dart_project.h" 42 | "fl_engine.h" 43 | "fl_json_message_codec.h" 44 | "fl_json_method_codec.h" 45 | "fl_message_codec.h" 46 | "fl_method_call.h" 47 | "fl_method_channel.h" 48 | "fl_method_codec.h" 49 | "fl_method_response.h" 50 | "fl_plugin_registrar.h" 51 | "fl_plugin_registry.h" 52 | "fl_standard_message_codec.h" 53 | "fl_standard_method_codec.h" 54 | "fl_string_codec.h" 55 | "fl_value.h" 56 | "fl_view.h" 57 | "flutter_linux.h" 58 | ) 59 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 60 | add_library(flutter INTERFACE) 61 | target_include_directories(flutter INTERFACE 62 | "${EPHEMERAL_DIR}" 63 | ) 64 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 65 | target_link_libraries(flutter INTERFACE 66 | PkgConfig::GTK 67 | PkgConfig::GLIB 68 | PkgConfig::GIO 69 | ) 70 | add_dependencies(flutter flutter_assemble) 71 | 72 | # === Flutter tool backend === 73 | # _phony_ is a non-existent file to force this command to run every time, 74 | # since currently there's no way to get a full input/output list from the 75 | # flutter tool. 76 | add_custom_command( 77 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 78 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 79 | COMMAND ${CMAKE_COMMAND} -E env 80 | ${FLUTTER_TOOL_ENVIRONMENT} 81 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 82 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 83 | VERBATIM 84 | ) 85 | add_custom_target(flutter_assemble DEPENDS 86 | "${FLUTTER_LIBRARY}" 87 | ${FLUTTER_LIBRARY_HEADERS} 88 | ) 89 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | 10 | void fl_register_plugins(FlPluginRegistry* registry) { 11 | } 12 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | ) 7 | 8 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 9 | ) 10 | 11 | set(PLUGIN_BUNDLED_LIBRARIES) 12 | 13 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 14 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 15 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 16 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 18 | endforeach(plugin) 19 | 20 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 21 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 22 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 23 | endforeach(ffi_plugin) 24 | -------------------------------------------------------------------------------- /example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /example/linux/my_application.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | #include 4 | #ifdef GDK_WINDOWING_X11 5 | #include 6 | #endif 7 | 8 | #include "flutter/generated_plugin_registrant.h" 9 | 10 | struct _MyApplication { 11 | GtkApplication parent_instance; 12 | char** dart_entrypoint_arguments; 13 | }; 14 | 15 | G_DEFINE_TYPE(MyApplication, my_application, GTK_TYPE_APPLICATION) 16 | 17 | // Implements GApplication::activate. 18 | static void my_application_activate(GApplication* application) { 19 | MyApplication* self = MY_APPLICATION(application); 20 | GtkWindow* window = 21 | GTK_WINDOW(gtk_application_window_new(GTK_APPLICATION(application))); 22 | 23 | // Use a header bar when running in GNOME as this is the common style used 24 | // by applications and is the setup most users will be using (e.g. Ubuntu 25 | // desktop). 26 | // If running on X and not using GNOME then just use a traditional title bar 27 | // in case the window manager does more exotic layout, e.g. tiling. 28 | // If running on Wayland assume the header bar will work (may need changing 29 | // if future cases occur). 30 | gboolean use_header_bar = TRUE; 31 | #ifdef GDK_WINDOWING_X11 32 | GdkScreen* screen = gtk_window_get_screen(window); 33 | if (GDK_IS_X11_SCREEN(screen)) { 34 | const gchar* wm_name = gdk_x11_screen_get_window_manager_name(screen); 35 | if (g_strcmp0(wm_name, "GNOME Shell") != 0) { 36 | use_header_bar = FALSE; 37 | } 38 | } 39 | #endif 40 | if (use_header_bar) { 41 | GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new()); 42 | gtk_widget_show(GTK_WIDGET(header_bar)); 43 | gtk_header_bar_set_title(header_bar, "example"); 44 | gtk_header_bar_set_show_close_button(header_bar, TRUE); 45 | gtk_window_set_titlebar(window, GTK_WIDGET(header_bar)); 46 | } else { 47 | gtk_window_set_title(window, "example"); 48 | } 49 | 50 | gtk_window_set_default_size(window, 1280, 720); 51 | gtk_widget_show(GTK_WIDGET(window)); 52 | 53 | g_autoptr(FlDartProject) project = fl_dart_project_new(); 54 | fl_dart_project_set_dart_entrypoint_arguments(project, self->dart_entrypoint_arguments); 55 | 56 | FlView* view = fl_view_new(project); 57 | gtk_widget_show(GTK_WIDGET(view)); 58 | gtk_container_add(GTK_CONTAINER(window), GTK_WIDGET(view)); 59 | 60 | fl_register_plugins(FL_PLUGIN_REGISTRY(view)); 61 | 62 | gtk_widget_grab_focus(GTK_WIDGET(view)); 63 | } 64 | 65 | // Implements GApplication::local_command_line. 66 | static gboolean my_application_local_command_line(GApplication* application, gchar*** arguments, int* exit_status) { 67 | MyApplication* self = MY_APPLICATION(application); 68 | // Strip out the first argument as it is the binary name. 69 | self->dart_entrypoint_arguments = g_strdupv(*arguments + 1); 70 | 71 | g_autoptr(GError) error = nullptr; 72 | if (!g_application_register(application, nullptr, &error)) { 73 | g_warning("Failed to register: %s", error->message); 74 | *exit_status = 1; 75 | return TRUE; 76 | } 77 | 78 | g_application_activate(application); 79 | *exit_status = 0; 80 | 81 | return TRUE; 82 | } 83 | 84 | // Implements GObject::dispose. 85 | static void my_application_dispose(GObject* object) { 86 | MyApplication* self = MY_APPLICATION(object); 87 | g_clear_pointer(&self->dart_entrypoint_arguments, g_strfreev); 88 | G_OBJECT_CLASS(my_application_parent_class)->dispose(object); 89 | } 90 | 91 | static void my_application_class_init(MyApplicationClass* klass) { 92 | G_APPLICATION_CLASS(klass)->activate = my_application_activate; 93 | G_APPLICATION_CLASS(klass)->local_command_line = my_application_local_command_line; 94 | G_OBJECT_CLASS(klass)->dispose = my_application_dispose; 95 | } 96 | 97 | static void my_application_init(MyApplication* self) {} 98 | 99 | MyApplication* my_application_new() { 100 | return MY_APPLICATION(g_object_new(my_application_get_type(), 101 | "application-id", APPLICATION_ID, 102 | "flags", G_APPLICATION_NON_UNIQUE, 103 | nullptr)); 104 | } 105 | -------------------------------------------------------------------------------- /example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import geolocator_apple 9 | import package_info_plus 10 | 11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 12 | GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) 13 | FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) 14 | } 15 | -------------------------------------------------------------------------------- /example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.13' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | end 35 | 36 | post_install do |installer| 37 | installer.pods_project.targets.each do |target| 38 | flutter_additional_macos_build_settings(target) 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @NSApplicationMain 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.example.googlemapplacepicker.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2022 com.example.googlemapplacepicker. All rights reserved. 15 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController.init() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | cupertino_icons: 45 | dependency: "direct main" 46 | description: 47 | name: cupertino_icons 48 | sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.0.5" 52 | dio: 53 | dependency: transitive 54 | description: 55 | name: dio 56 | sha256: "2644a9e0965a7aa3deb09cb8ce4081db4450c178f472818c8cd34216a3070d7b" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "5.0.2" 60 | fake_async: 61 | dependency: transitive 62 | description: 63 | name: fake_async 64 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "1.3.1" 68 | ffi: 69 | dependency: transitive 70 | description: 71 | name: ffi 72 | sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 73 | url: "https://pub.dev" 74 | source: hosted 75 | version: "2.0.1" 76 | flutter: 77 | dependency: "direct main" 78 | description: flutter 79 | source: sdk 80 | version: "0.0.0" 81 | flutter_lints: 82 | dependency: "direct dev" 83 | description: 84 | name: flutter_lints 85 | sha256: aeb0b80a8b3709709c9cc496cdc027c5b3216796bc0af0ce1007eaf24464fd4c 86 | url: "https://pub.dev" 87 | source: hosted 88 | version: "2.0.1" 89 | flutter_place_picker: 90 | dependency: "direct main" 91 | description: 92 | path: ".." 93 | relative: true 94 | source: path 95 | version: "0.0.1-dev.5" 96 | flutter_plugin_android_lifecycle: 97 | dependency: transitive 98 | description: 99 | name: flutter_plugin_android_lifecycle 100 | sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" 101 | url: "https://pub.dev" 102 | source: hosted 103 | version: "2.0.7" 104 | flutter_test: 105 | dependency: "direct dev" 106 | description: flutter 107 | source: sdk 108 | version: "0.0.0" 109 | flutter_web_plugins: 110 | dependency: transitive 111 | description: flutter 112 | source: sdk 113 | version: "0.0.0" 114 | geocoding: 115 | dependency: transitive 116 | description: 117 | name: geocoding 118 | sha256: b34c0501bbbaf3190b85bef3078b27cf66c28a8915c6d3af50d67f356aa7da31 119 | url: "https://pub.dev" 120 | source: hosted 121 | version: "2.1.0" 122 | geocoding_android: 123 | dependency: transitive 124 | description: 125 | name: geocoding_android 126 | sha256: "5a1fc0cec9b0497b44ca31c1fa8d1c891f3aded1053e6bb2eac075d3bd1bf046" 127 | url: "https://pub.dev" 128 | source: hosted 129 | version: "2.1.0" 130 | geocoding_ios: 131 | dependency: transitive 132 | description: 133 | name: geocoding_ios 134 | sha256: c85495ce8fb34e4fbd2dd8fc5f79263d622d9f88c4af948c965daf6b27a7f3a1 135 | url: "https://pub.dev" 136 | source: hosted 137 | version: "2.1.0" 138 | geocoding_platform_interface: 139 | dependency: transitive 140 | description: 141 | name: geocoding_platform_interface 142 | sha256: "8848605d307d844d89937cdb4b8ad7dfa880552078f310fa24d8a460f6dddab4" 143 | url: "https://pub.dev" 144 | source: hosted 145 | version: "2.0.1" 146 | geolocator: 147 | dependency: transitive 148 | description: 149 | name: geolocator 150 | sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "9.0.2" 154 | geolocator_android: 155 | dependency: transitive 156 | description: 157 | name: geolocator_android 158 | sha256: "2ba24690aee0a3e1b6b7bd47c2711a50c874e95e4c758346589d35194adf6d6a" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "4.1.7" 162 | geolocator_apple: 163 | dependency: transitive 164 | description: 165 | name: geolocator_apple 166 | sha256: "1b17544d250bbfebd2f36157f9ce094b0b07967441c1010243d6ea04f6f5bfe8" 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "2.2.1" 170 | geolocator_platform_interface: 171 | dependency: transitive 172 | description: 173 | name: geolocator_platform_interface 174 | sha256: "8c10ba5c825abdcc337ba918fbc1d3a5a2b006affe6ba610e3143cd32f54388d" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "4.0.6" 178 | geolocator_web: 179 | dependency: transitive 180 | description: 181 | name: geolocator_web 182 | sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "2.1.6" 186 | geolocator_windows: 187 | dependency: transitive 188 | description: 189 | name: geolocator_windows 190 | sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "0.1.1" 194 | google_api_headers: 195 | dependency: transitive 196 | description: 197 | name: google_api_headers 198 | sha256: ac6f4e27e35c9eb4fbe8ce4ce7380e651d3a7bee3ad4c2ff30e67aaa73f005d3 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "1.5.0+1" 202 | google_maps_flutter: 203 | dependency: "direct main" 204 | description: 205 | name: google_maps_flutter 206 | sha256: "24392ef192f3b00bcd93151375676805a9933574423a5bd5509a0ead2e8a4215" 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "2.2.5" 210 | google_maps_flutter_android: 211 | dependency: transitive 212 | description: 213 | name: google_maps_flutter_android 214 | sha256: "9fd11f2ee960f8a10be95b64f261b1c3521e1d4c9f313f5547123b72ac1db507" 215 | url: "https://pub.dev" 216 | source: hosted 217 | version: "2.1.10" 218 | google_maps_flutter_ios: 219 | dependency: transitive 220 | description: 221 | name: google_maps_flutter_ios 222 | sha256: "71213e497600e0c67cf7a096f643e58a72ed36334456c32c7ae0a6b4698018df" 223 | url: "https://pub.dev" 224 | source: hosted 225 | version: "2.1.11" 226 | google_maps_flutter_platform_interface: 227 | dependency: transitive 228 | description: 229 | name: google_maps_flutter_platform_interface 230 | sha256: "0a91acaa7ab6a438f428efe49f145a2b48f18ff039301ee2232696e18bf78784" 231 | url: "https://pub.dev" 232 | source: hosted 233 | version: "2.2.2" 234 | google_maps_webservice: 235 | dependency: transitive 236 | description: 237 | name: google_maps_webservice 238 | sha256: d0ae4e4508afd74a3f051565261a3cdbae59db29448f9b6e6beb5674545e1eb7 239 | url: "https://pub.dev" 240 | source: hosted 241 | version: "0.0.20-nullsafety.5" 242 | http: 243 | dependency: transitive 244 | description: 245 | name: http 246 | sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" 247 | url: "https://pub.dev" 248 | source: hosted 249 | version: "0.13.5" 250 | http_parser: 251 | dependency: transitive 252 | description: 253 | name: http_parser 254 | sha256: db3060f22889f3d9d55f6a217565486737037eec3609f7f3eca4d0c67ee0d8a0 255 | url: "https://pub.dev" 256 | source: hosted 257 | version: "4.0.1" 258 | js: 259 | dependency: transitive 260 | description: 261 | name: js 262 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 263 | url: "https://pub.dev" 264 | source: hosted 265 | version: "0.6.5" 266 | json_annotation: 267 | dependency: transitive 268 | description: 269 | name: json_annotation 270 | sha256: cb314f00b2488de7bc575207e54402cd2f92363f333a7933fd1b0631af226baa 271 | url: "https://pub.dev" 272 | source: hosted 273 | version: "4.6.0" 274 | lints: 275 | dependency: transitive 276 | description: 277 | name: lints 278 | sha256: "5cfd6509652ff5e7fe149b6df4859e687fca9048437857cb2e65c8d780f396e3" 279 | url: "https://pub.dev" 280 | source: hosted 281 | version: "2.0.0" 282 | matcher: 283 | dependency: transitive 284 | description: 285 | name: matcher 286 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 287 | url: "https://pub.dev" 288 | source: hosted 289 | version: "0.12.13" 290 | material_color_utilities: 291 | dependency: transitive 292 | description: 293 | name: material_color_utilities 294 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 295 | url: "https://pub.dev" 296 | source: hosted 297 | version: "0.2.0" 298 | meta: 299 | dependency: transitive 300 | description: 301 | name: meta 302 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 303 | url: "https://pub.dev" 304 | source: hosted 305 | version: "1.8.0" 306 | nested: 307 | dependency: transitive 308 | description: 309 | name: nested 310 | sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" 311 | url: "https://pub.dev" 312 | source: hosted 313 | version: "1.0.0" 314 | package_info_plus: 315 | dependency: transitive 316 | description: 317 | name: package_info_plus 318 | sha256: "8df5ab0a481d7dc20c0e63809e90a588e496d276ba53358afc4c4443d0a00697" 319 | url: "https://pub.dev" 320 | source: hosted 321 | version: "3.0.3" 322 | package_info_plus_platform_interface: 323 | dependency: transitive 324 | description: 325 | name: package_info_plus_platform_interface 326 | sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" 327 | url: "https://pub.dev" 328 | source: hosted 329 | version: "2.0.1" 330 | path: 331 | dependency: transitive 332 | description: 333 | name: path 334 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 335 | url: "https://pub.dev" 336 | source: hosted 337 | version: "1.8.2" 338 | permission_handler: 339 | dependency: transitive 340 | description: 341 | name: permission_handler 342 | sha256: "33c6a1253d1f95fd06fa74b65b7ba907ae9811f9d5c1d3150e51417d04b8d6a8" 343 | url: "https://pub.dev" 344 | source: hosted 345 | version: "10.2.0" 346 | permission_handler_android: 347 | dependency: transitive 348 | description: 349 | name: permission_handler_android 350 | sha256: "8028362b40c4a45298f1cbfccd227c8dd6caf0e27088a69f2ba2ab15464159e2" 351 | url: "https://pub.dev" 352 | source: hosted 353 | version: "10.2.0" 354 | permission_handler_apple: 355 | dependency: transitive 356 | description: 357 | name: permission_handler_apple 358 | sha256: "9c370ef6a18b1c4b2f7f35944d644a56aa23576f23abee654cf73968de93f163" 359 | url: "https://pub.dev" 360 | source: hosted 361 | version: "9.0.7" 362 | permission_handler_platform_interface: 363 | dependency: transitive 364 | description: 365 | name: permission_handler_platform_interface 366 | sha256: "68abbc472002b5e6dfce47fe9898c6b7d8328d58b5d2524f75e277c07a97eb84" 367 | url: "https://pub.dev" 368 | source: hosted 369 | version: "3.9.0" 370 | permission_handler_windows: 371 | dependency: transitive 372 | description: 373 | name: permission_handler_windows 374 | sha256: f67cab14b4328574938ecea2db3475dad7af7ead6afab6338772c5f88963e38b 375 | url: "https://pub.dev" 376 | source: hosted 377 | version: "0.1.2" 378 | plugin_platform_interface: 379 | dependency: transitive 380 | description: 381 | name: plugin_platform_interface 382 | sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" 383 | url: "https://pub.dev" 384 | source: hosted 385 | version: "2.1.2" 386 | provider: 387 | dependency: transitive 388 | description: 389 | name: provider 390 | sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f 391 | url: "https://pub.dev" 392 | source: hosted 393 | version: "6.0.5" 394 | sky_engine: 395 | dependency: transitive 396 | description: flutter 397 | source: sdk 398 | version: "0.0.99" 399 | source_span: 400 | dependency: transitive 401 | description: 402 | name: source_span 403 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 404 | url: "https://pub.dev" 405 | source: hosted 406 | version: "1.9.1" 407 | stack_trace: 408 | dependency: transitive 409 | description: 410 | name: stack_trace 411 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 412 | url: "https://pub.dev" 413 | source: hosted 414 | version: "1.11.0" 415 | stream_channel: 416 | dependency: transitive 417 | description: 418 | name: stream_channel 419 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 420 | url: "https://pub.dev" 421 | source: hosted 422 | version: "2.1.1" 423 | stream_transform: 424 | dependency: transitive 425 | description: 426 | name: stream_transform 427 | sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e 428 | url: "https://pub.dev" 429 | source: hosted 430 | version: "2.0.0" 431 | string_scanner: 432 | dependency: transitive 433 | description: 434 | name: string_scanner 435 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 436 | url: "https://pub.dev" 437 | source: hosted 438 | version: "1.2.0" 439 | term_glyph: 440 | dependency: transitive 441 | description: 442 | name: term_glyph 443 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 444 | url: "https://pub.dev" 445 | source: hosted 446 | version: "1.2.1" 447 | test_api: 448 | dependency: transitive 449 | description: 450 | name: test_api 451 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 452 | url: "https://pub.dev" 453 | source: hosted 454 | version: "0.4.16" 455 | tuple: 456 | dependency: transitive 457 | description: 458 | name: tuple 459 | sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" 460 | url: "https://pub.dev" 461 | source: hosted 462 | version: "2.0.1" 463 | typed_data: 464 | dependency: transitive 465 | description: 466 | name: typed_data 467 | sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" 468 | url: "https://pub.dev" 469 | source: hosted 470 | version: "1.3.1" 471 | vector_math: 472 | dependency: transitive 473 | description: 474 | name: vector_math 475 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 476 | url: "https://pub.dev" 477 | source: hosted 478 | version: "2.1.4" 479 | win32: 480 | dependency: transitive 481 | description: 482 | name: win32 483 | sha256: "6b75ac2ddd42f5c226fdaf4498a2b04071c06f1f2b8f7ab1c3f77cc7f2285ff1" 484 | url: "https://pub.dev" 485 | source: hosted 486 | version: "2.7.0" 487 | sdks: 488 | dart: ">=2.18.0 <3.0.0" 489 | flutter: ">=3.0.0" 490 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: example 2 | description: A new Flutter project. 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | publish_to: none 17 | 18 | environment: 19 | sdk: '>=2.12.0 <3.0.0' 20 | 21 | dependencies: 22 | flutter: 23 | sdk: flutter 24 | 25 | # The following adds the Cupertino Icons font to your application. 26 | # Use with the CupertinoIcons class for iOS style icons. 27 | cupertino_icons: ^1.0.5 28 | 29 | flutter_place_picker: 30 | path: ../ 31 | google_maps_flutter: ^2.2.5 32 | 33 | 34 | dev_dependencies: 35 | flutter_lints: ^2.0.1 36 | flutter_test: 37 | sdk: flutter 38 | 39 | # For information on the generic Dart part of this file, see the 40 | # following page: https://dart.dev/tools/pub/pubspec 41 | 42 | # The following section is specific to Flutter. 43 | flutter: 44 | # The following line ensures that the Material Icons font is 45 | # included with your application, so that you can use the icons in 46 | # the material Icons class. 47 | uses-material-design: true 48 | # To add assets to your application, add an assets section, like this: 49 | # assets: 50 | # - images/a_dot_burr.jpeg 51 | # - images/a_dot_ham.jpeg 52 | # An image asset can refer to one or more resolution-specific "variants", see 53 | # https://flutter.dev/assets-and-images/#resolution-aware. 54 | # For details regarding adding assets from package dependencies, see 55 | # https://flutter.dev/assets-and-images/#from-packages 56 | # To add custom fonts to your application, add a fonts section here, 57 | # in this "flutter" section. Each entry in this list should have a 58 | # "family" key with the font family name, and a "fonts" key with a 59 | # list giving the asset and other descriptors for the font. For 60 | # example: 61 | # fonts: 62 | # - family: Schyler 63 | # fonts: 64 | # - asset: fonts/Schyler-Regular.ttf 65 | # - asset: fonts/Schyler-Italic.ttf 66 | # style: italic 67 | # - family: Trajan Pro 68 | # fonts: 69 | # - asset: fonts/TrajanPro.ttf 70 | # - asset: fonts/TrajanPro_Bold.ttf 71 | # weight: 700 72 | # 73 | # For details regarding fonts from package dependencies, 74 | # see https://flutter.dev/custom-fonts/#from-packages 75 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/web/favicon.png -------------------------------------------------------------------------------- /example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /example/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Project-level configuration. 2 | cmake_minimum_required(VERSION 3.14) 3 | project(example LANGUAGES CXX) 4 | 5 | # The name of the executable created for the application. Change this to change 6 | # the on-disk name of your application. 7 | set(BINARY_NAME "example") 8 | 9 | # Explicitly opt in to modern CMake behaviors to avoid warnings with recent 10 | # versions of CMake. 11 | cmake_policy(SET CMP0063 NEW) 12 | 13 | # Define build configuration option. 14 | get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) 15 | if(IS_MULTICONFIG) 16 | set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" 17 | CACHE STRING "" FORCE) 18 | else() 19 | if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) 20 | set(CMAKE_BUILD_TYPE "Debug" CACHE 21 | STRING "Flutter build mode" FORCE) 22 | set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS 23 | "Debug" "Profile" "Release") 24 | endif() 25 | endif() 26 | # Define settings for the Profile build mode. 27 | set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") 28 | set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") 29 | set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") 30 | set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") 31 | 32 | # Use Unicode for all projects. 33 | add_definitions(-DUNICODE -D_UNICODE) 34 | 35 | # Compilation settings that should be applied to most targets. 36 | # 37 | # Be cautious about adding new options here, as plugins use this function by 38 | # default. In most cases, you should add new options to specific targets instead 39 | # of modifying this function. 40 | function(APPLY_STANDARD_SETTINGS TARGET) 41 | target_compile_features(${TARGET} PUBLIC cxx_std_17) 42 | target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") 43 | target_compile_options(${TARGET} PRIVATE /EHsc) 44 | target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") 45 | target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") 46 | endfunction() 47 | 48 | # Flutter library and tool build rules. 49 | set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") 50 | add_subdirectory(${FLUTTER_MANAGED_DIR}) 51 | 52 | # Application build; see runner/CMakeLists.txt. 53 | add_subdirectory("runner") 54 | 55 | # Generated plugin build rules, which manage building the plugins and adding 56 | # them to the application. 57 | include(flutter/generated_plugins.cmake) 58 | 59 | 60 | # === Installation === 61 | # Support files are copied into place next to the executable, so that it can 62 | # run in place. This is done instead of making a separate bundle (as on Linux) 63 | # so that building and running from within Visual Studio will work. 64 | set(BUILD_BUNDLE_DIR "$") 65 | # Make the "install" step default, as it's required to run. 66 | set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) 67 | if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 68 | set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) 69 | endif() 70 | 71 | set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") 72 | set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") 73 | 74 | install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" 75 | COMPONENT Runtime) 76 | 77 | install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 78 | COMPONENT Runtime) 79 | 80 | install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 81 | COMPONENT Runtime) 82 | 83 | if(PLUGIN_BUNDLED_LIBRARIES) 84 | install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" 85 | DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" 86 | COMPONENT Runtime) 87 | endif() 88 | 89 | # Fully re-copy the assets directory on each build to avoid having stale files 90 | # from a previous install. 91 | set(FLUTTER_ASSET_DIR_NAME "flutter_assets") 92 | install(CODE " 93 | file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") 94 | " COMPONENT Runtime) 95 | install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" 96 | DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) 97 | 98 | # Install the AOT library on non-Debug builds only. 99 | install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" 100 | CONFIGURATIONS Profile;Release 101 | COMPONENT Runtime) 102 | -------------------------------------------------------------------------------- /example/windows/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # This file controls Flutter-level build steps. It should not be edited. 2 | cmake_minimum_required(VERSION 3.14) 3 | 4 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 5 | 6 | # Configuration provided via flutter tool. 7 | include(${EPHEMERAL_DIR}/generated_config.cmake) 8 | 9 | # TODO: Move the rest of this into files in ephemeral. See 10 | # https://github.com/flutter/flutter/issues/57146. 11 | set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") 12 | 13 | # === Flutter Library === 14 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") 15 | 16 | # Published to parent scope for install step. 17 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 18 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 19 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 20 | set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) 21 | 22 | list(APPEND FLUTTER_LIBRARY_HEADERS 23 | "flutter_export.h" 24 | "flutter_windows.h" 25 | "flutter_messenger.h" 26 | "flutter_plugin_registrar.h" 27 | "flutter_texture_registrar.h" 28 | ) 29 | list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") 30 | add_library(flutter INTERFACE) 31 | target_include_directories(flutter INTERFACE 32 | "${EPHEMERAL_DIR}" 33 | ) 34 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") 35 | add_dependencies(flutter flutter_assemble) 36 | 37 | # === Wrapper === 38 | list(APPEND CPP_WRAPPER_SOURCES_CORE 39 | "core_implementations.cc" 40 | "standard_codec.cc" 41 | ) 42 | list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") 43 | list(APPEND CPP_WRAPPER_SOURCES_PLUGIN 44 | "plugin_registrar.cc" 45 | ) 46 | list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") 47 | list(APPEND CPP_WRAPPER_SOURCES_APP 48 | "flutter_engine.cc" 49 | "flutter_view_controller.cc" 50 | ) 51 | list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") 52 | 53 | # Wrapper sources needed for a plugin. 54 | add_library(flutter_wrapper_plugin STATIC 55 | ${CPP_WRAPPER_SOURCES_CORE} 56 | ${CPP_WRAPPER_SOURCES_PLUGIN} 57 | ) 58 | apply_standard_settings(flutter_wrapper_plugin) 59 | set_target_properties(flutter_wrapper_plugin PROPERTIES 60 | POSITION_INDEPENDENT_CODE ON) 61 | set_target_properties(flutter_wrapper_plugin PROPERTIES 62 | CXX_VISIBILITY_PRESET hidden) 63 | target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) 64 | target_include_directories(flutter_wrapper_plugin PUBLIC 65 | "${WRAPPER_ROOT}/include" 66 | ) 67 | add_dependencies(flutter_wrapper_plugin flutter_assemble) 68 | 69 | # Wrapper sources needed for the runner. 70 | add_library(flutter_wrapper_app STATIC 71 | ${CPP_WRAPPER_SOURCES_CORE} 72 | ${CPP_WRAPPER_SOURCES_APP} 73 | ) 74 | apply_standard_settings(flutter_wrapper_app) 75 | target_link_libraries(flutter_wrapper_app PUBLIC flutter) 76 | target_include_directories(flutter_wrapper_app PUBLIC 77 | "${WRAPPER_ROOT}/include" 78 | ) 79 | add_dependencies(flutter_wrapper_app flutter_assemble) 80 | 81 | # === Flutter tool backend === 82 | # _phony_ is a non-existent file to force this command to run every time, 83 | # since currently there's no way to get a full input/output list from the 84 | # flutter tool. 85 | set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") 86 | set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) 87 | add_custom_command( 88 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 89 | ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} 90 | ${CPP_WRAPPER_SOURCES_APP} 91 | ${PHONY_OUTPUT} 92 | COMMAND ${CMAKE_COMMAND} -E env 93 | ${FLUTTER_TOOL_ENVIRONMENT} 94 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" 95 | windows-x64 $ 96 | VERBATIM 97 | ) 98 | add_custom_target(flutter_assemble DEPENDS 99 | "${FLUTTER_LIBRARY}" 100 | ${FLUTTER_LIBRARY_HEADERS} 101 | ${CPP_WRAPPER_SOURCES_CORE} 102 | ${CPP_WRAPPER_SOURCES_PLUGIN} 103 | ${CPP_WRAPPER_SOURCES_APP} 104 | ) 105 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | #include 11 | 12 | void RegisterPlugins(flutter::PluginRegistry* registry) { 13 | GeolocatorWindowsRegisterWithRegistrar( 14 | registry->GetRegistrarForPlugin("GeolocatorWindows")); 15 | PermissionHandlerWindowsPluginRegisterWithRegistrar( 16 | registry->GetRegistrarForPlugin("PermissionHandlerWindowsPlugin")); 17 | } 18 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | geolocator_windows 7 | permission_handler_windows 8 | ) 9 | 10 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 11 | ) 12 | 13 | set(PLUGIN_BUNDLED_LIBRARIES) 14 | 15 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 16 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 17 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 20 | endforeach(plugin) 21 | 22 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 23 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 24 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 25 | endforeach(ffi_plugin) 26 | -------------------------------------------------------------------------------- /example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 37 | 38 | # Run the Flutter tool portions of the build. This must not be removed. 39 | add_dependencies(${BINARY_NAME} flutter_assemble) 40 | -------------------------------------------------------------------------------- /example/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.example.googlemapplacepicker" "\0" 93 | VALUE "FileDescription", "example" "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "example" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.example.googlemapplacepicker. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "example.exe" "\0" 98 | VALUE "ProductName", "example" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | return true; 30 | } 31 | 32 | void FlutterWindow::OnDestroy() { 33 | if (flutter_controller_) { 34 | flutter_controller_ = nullptr; 35 | } 36 | 37 | Win32Window::OnDestroy(); 38 | } 39 | 40 | LRESULT 41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 42 | WPARAM const wparam, 43 | LPARAM const lparam) noexcept { 44 | // Give Flutter, including plugins, an opportunity to handle window messages. 45 | if (flutter_controller_) { 46 | std::optional result = 47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 48 | lparam); 49 | if (result) { 50 | return *result; 51 | } 52 | } 53 | 54 | switch (message) { 55 | case WM_FONTCHANGE: 56 | flutter_controller_->engine()->ReloadSystemFonts(); 57 | break; 58 | } 59 | 60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 61 | } 62 | -------------------------------------------------------------------------------- /example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.CreateAndShow(L"example", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /example/windows/runner/win32_window.cpp: -------------------------------------------------------------------------------- 1 | #include "win32_window.h" 2 | 3 | #include 4 | 5 | #include "resource.h" 6 | 7 | namespace { 8 | 9 | constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; 10 | 11 | // The number of Win32Window objects that currently exist. 12 | static int g_active_window_count = 0; 13 | 14 | using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); 15 | 16 | // Scale helper to convert logical scaler values to physical using passed in 17 | // scale factor 18 | int Scale(int source, double scale_factor) { 19 | return static_cast(source * scale_factor); 20 | } 21 | 22 | // Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. 23 | // This API is only needed for PerMonitor V1 awareness mode. 24 | void EnableFullDpiSupportIfAvailable(HWND hwnd) { 25 | HMODULE user32_module = LoadLibraryA("User32.dll"); 26 | if (!user32_module) { 27 | return; 28 | } 29 | auto enable_non_client_dpi_scaling = 30 | reinterpret_cast( 31 | GetProcAddress(user32_module, "EnableNonClientDpiScaling")); 32 | if (enable_non_client_dpi_scaling != nullptr) { 33 | enable_non_client_dpi_scaling(hwnd); 34 | FreeLibrary(user32_module); 35 | } 36 | } 37 | 38 | } // namespace 39 | 40 | // Manages the Win32Window's window class registration. 41 | class WindowClassRegistrar { 42 | public: 43 | ~WindowClassRegistrar() = default; 44 | 45 | // Returns the singleton registar instance. 46 | static WindowClassRegistrar* GetInstance() { 47 | if (!instance_) { 48 | instance_ = new WindowClassRegistrar(); 49 | } 50 | return instance_; 51 | } 52 | 53 | // Returns the name of the window class, registering the class if it hasn't 54 | // previously been registered. 55 | const wchar_t* GetWindowClass(); 56 | 57 | // Unregisters the window class. Should only be called if there are no 58 | // instances of the window. 59 | void UnregisterWindowClass(); 60 | 61 | private: 62 | WindowClassRegistrar() = default; 63 | 64 | static WindowClassRegistrar* instance_; 65 | 66 | bool class_registered_ = false; 67 | }; 68 | 69 | WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; 70 | 71 | const wchar_t* WindowClassRegistrar::GetWindowClass() { 72 | if (!class_registered_) { 73 | WNDCLASS window_class{}; 74 | window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); 75 | window_class.lpszClassName = kWindowClassName; 76 | window_class.style = CS_HREDRAW | CS_VREDRAW; 77 | window_class.cbClsExtra = 0; 78 | window_class.cbWndExtra = 0; 79 | window_class.hInstance = GetModuleHandle(nullptr); 80 | window_class.hIcon = 81 | LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); 82 | window_class.hbrBackground = 0; 83 | window_class.lpszMenuName = nullptr; 84 | window_class.lpfnWndProc = Win32Window::WndProc; 85 | RegisterClass(&window_class); 86 | class_registered_ = true; 87 | } 88 | return kWindowClassName; 89 | } 90 | 91 | void WindowClassRegistrar::UnregisterWindowClass() { 92 | UnregisterClass(kWindowClassName, nullptr); 93 | class_registered_ = false; 94 | } 95 | 96 | Win32Window::Win32Window() { 97 | ++g_active_window_count; 98 | } 99 | 100 | Win32Window::~Win32Window() { 101 | --g_active_window_count; 102 | Destroy(); 103 | } 104 | 105 | bool Win32Window::CreateAndShow(const std::wstring& title, 106 | const Point& origin, 107 | const Size& size) { 108 | Destroy(); 109 | 110 | const wchar_t* window_class = 111 | WindowClassRegistrar::GetInstance()->GetWindowClass(); 112 | 113 | const POINT target_point = {static_cast(origin.x), 114 | static_cast(origin.y)}; 115 | HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); 116 | UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); 117 | double scale_factor = dpi / 96.0; 118 | 119 | HWND window = CreateWindow( 120 | window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 121 | Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), 122 | Scale(size.width, scale_factor), Scale(size.height, scale_factor), 123 | nullptr, nullptr, GetModuleHandle(nullptr), this); 124 | 125 | if (!window) { 126 | return false; 127 | } 128 | 129 | return OnCreate(); 130 | } 131 | 132 | // static 133 | LRESULT CALLBACK Win32Window::WndProc(HWND const window, 134 | UINT const message, 135 | WPARAM const wparam, 136 | LPARAM const lparam) noexcept { 137 | if (message == WM_NCCREATE) { 138 | auto window_struct = reinterpret_cast(lparam); 139 | SetWindowLongPtr(window, GWLP_USERDATA, 140 | reinterpret_cast(window_struct->lpCreateParams)); 141 | 142 | auto that = static_cast(window_struct->lpCreateParams); 143 | EnableFullDpiSupportIfAvailable(window); 144 | that->window_handle_ = window; 145 | } else if (Win32Window* that = GetThisFromHandle(window)) { 146 | return that->MessageHandler(window, message, wparam, lparam); 147 | } 148 | 149 | return DefWindowProc(window, message, wparam, lparam); 150 | } 151 | 152 | LRESULT 153 | Win32Window::MessageHandler(HWND hwnd, 154 | UINT const message, 155 | WPARAM const wparam, 156 | LPARAM const lparam) noexcept { 157 | switch (message) { 158 | case WM_DESTROY: 159 | window_handle_ = nullptr; 160 | Destroy(); 161 | if (quit_on_close_) { 162 | PostQuitMessage(0); 163 | } 164 | return 0; 165 | 166 | case WM_DPICHANGED: { 167 | auto newRectSize = reinterpret_cast(lparam); 168 | LONG newWidth = newRectSize->right - newRectSize->left; 169 | LONG newHeight = newRectSize->bottom - newRectSize->top; 170 | 171 | SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, 172 | newHeight, SWP_NOZORDER | SWP_NOACTIVATE); 173 | 174 | return 0; 175 | } 176 | case WM_SIZE: { 177 | RECT rect = GetClientArea(); 178 | if (child_content_ != nullptr) { 179 | // Size and position the child window. 180 | MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, 181 | rect.bottom - rect.top, TRUE); 182 | } 183 | return 0; 184 | } 185 | 186 | case WM_ACTIVATE: 187 | if (child_content_ != nullptr) { 188 | SetFocus(child_content_); 189 | } 190 | return 0; 191 | } 192 | 193 | return DefWindowProc(window_handle_, message, wparam, lparam); 194 | } 195 | 196 | void Win32Window::Destroy() { 197 | OnDestroy(); 198 | 199 | if (window_handle_) { 200 | DestroyWindow(window_handle_); 201 | window_handle_ = nullptr; 202 | } 203 | if (g_active_window_count == 0) { 204 | WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); 205 | } 206 | } 207 | 208 | Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { 209 | return reinterpret_cast( 210 | GetWindowLongPtr(window, GWLP_USERDATA)); 211 | } 212 | 213 | void Win32Window::SetChildContent(HWND content) { 214 | child_content_ = content; 215 | SetParent(content, window_handle_); 216 | RECT frame = GetClientArea(); 217 | 218 | MoveWindow(content, frame.left, frame.top, frame.right - frame.left, 219 | frame.bottom - frame.top, true); 220 | 221 | SetFocus(child_content_); 222 | } 223 | 224 | RECT Win32Window::GetClientArea() { 225 | RECT frame; 226 | GetClientRect(window_handle_, &frame); 227 | return frame; 228 | } 229 | 230 | HWND Win32Window::GetHandle() { 231 | return window_handle_; 232 | } 233 | 234 | void Win32Window::SetQuitOnClose(bool quit_on_close) { 235 | quit_on_close_ = quit_on_close; 236 | } 237 | 238 | bool Win32Window::OnCreate() { 239 | // No-op; provided for subclasses. 240 | return true; 241 | } 242 | 243 | void Win32Window::OnDestroy() { 244 | // No-op; provided for subclasses. 245 | } 246 | -------------------------------------------------------------------------------- /example/windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /lib/flutter_place_picker.dart: -------------------------------------------------------------------------------- 1 | library flutter_place_picker; 2 | 3 | export 'models/pick_result.dart'; 4 | export 'widgets/floating_card.dart'; 5 | export 'widgets/rounded_frame.dart'; 6 | export 'src/picker.dart'; 7 | -------------------------------------------------------------------------------- /lib/models/local_prediction.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | 3 | import 'package:google_maps_webservice/places.dart'; 4 | 5 | class LocalPrediction { 6 | LocalPrediction({ 7 | this.placeId, 8 | this.formattedAddress, 9 | this.lat, 10 | this.lng, 11 | }); 12 | 13 | String? placeId; 14 | String? formattedAddress; 15 | List? matchedSubstrings; 16 | double? lat; 17 | double? lng; 18 | LocalMap? localMap; 19 | 20 | LocalPrediction.fromMap(dynamic map, String matchingStr) { 21 | placeId = map['place_id']; 22 | lat = map['lat']; 23 | lng = map['lng']; 24 | formattedAddress = map['formatted_address']; 25 | matchedSubstrings = [ 26 | MatchedSubstring(length: matchingStr.length, offset: 0) 27 | ]; 28 | localMap = LocalMap.fromMap(map); 29 | } 30 | toMap() { 31 | Map map = HashMap(); 32 | map["place_id"] = placeId; 33 | map["lat"] = lat; 34 | map["lat"] = lat; 35 | map["formatted_address"] = formattedAddress; 36 | map["local_map"] = localMap?.toMap(); 37 | return map; 38 | } 39 | } 40 | 41 | class LocalMap { 42 | LocalMap({ 43 | this.placeId, 44 | this.lat, 45 | this.lng, 46 | this.region, 47 | this.address, 48 | }); 49 | 50 | String? placeId; 51 | String? region; 52 | double? lat; 53 | double? lng; 54 | String? address; 55 | 56 | LocalMap.fromMap(dynamic map) { 57 | placeId = map['place_id']; 58 | lat = map['lat']; 59 | lng = map['lng']; 60 | address = map['address']; 61 | } 62 | toMap() { 63 | Map map = HashMap(); 64 | map["place_id"] = placeId; 65 | map["lat"] = lat; 66 | map["lat"] = lat; 67 | map["address"] = address; 68 | return map; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /lib/models/pick_result.dart: -------------------------------------------------------------------------------- 1 | import 'dart:collection'; 2 | 3 | import 'package:google_maps_webservice/geocoding.dart'; 4 | import 'package:google_maps_webservice/places.dart'; 5 | 6 | class PickResult { 7 | PickResult({ 8 | this.placeId, 9 | this.geometry, 10 | this.formattedAddress, 11 | this.types, 12 | this.addressComponents, 13 | this.adrAddress, 14 | this.formattedPhoneNumber, 15 | this.id, 16 | this.reference, 17 | this.icon, 18 | this.name, 19 | this.openingHours, 20 | this.photos, 21 | this.internationalPhoneNumber, 22 | this.priceLevel, 23 | this.rating, 24 | this.scope, 25 | this.url, 26 | this.vicinity, 27 | this.utcOffset, 28 | this.website, 29 | this.reviews, 30 | }); 31 | 32 | String? placeId; 33 | Geometry? geometry; 34 | String? formattedAddress; 35 | List? types; 36 | List? addressComponents; 37 | 38 | // Below results will not be fetched if 'usePlaceDetailSearch' is set to false (Defaults to false). 39 | String? adrAddress; 40 | String? formattedPhoneNumber; 41 | String? id; 42 | String? reference; 43 | String? icon; 44 | String? name; 45 | OpeningHoursDetail? openingHours; 46 | List? photos; 47 | String? internationalPhoneNumber; 48 | PriceLevel? priceLevel; 49 | num? rating; 50 | String? scope; 51 | String? url; 52 | String? vicinity; 53 | num? utcOffset; 54 | String? website; 55 | List? reviews; 56 | 57 | // factory PickResult.fromGeocodingResult(GeocodingResult result) { 58 | // return PickResult( 59 | // placeId: result.placeId, 60 | // geometry: result.geometry, 61 | // formattedAddress: result.formattedAddress, 62 | // types: result.types, 63 | // addressComponents: result.addressComponents, 64 | // ); 65 | // } 66 | 67 | PickResult.fromGeocodingResult(GeocodingResult result) { 68 | placeId = result.placeId; 69 | geometry = result.geometry; 70 | formattedAddress = result.formattedAddress; 71 | types = result.types; 72 | addressComponents = result.addressComponents; 73 | } 74 | toGeocodingMap() { 75 | Map map = HashMap(); 76 | map["placeId"] = placeId; 77 | map["geometry"] = geometry?.toJson(); 78 | map["formattedAddress"] = formattedAddress; 79 | map["types"] = types?.map((e) => e).toList(); 80 | map["addressComponents"] = 81 | addressComponents?.map((e) => e.toJson()).toList(); 82 | return map; 83 | } 84 | 85 | factory PickResult.fromPlaceDetailResult(PlaceDetails result) { 86 | return PickResult( 87 | placeId: result.placeId, 88 | geometry: result.geometry, 89 | formattedAddress: result.formattedAddress, 90 | types: result.types, 91 | addressComponents: result.addressComponents, 92 | adrAddress: result.adrAddress, 93 | formattedPhoneNumber: result.formattedPhoneNumber, 94 | id: result.id, 95 | reference: result.reference, 96 | icon: result.icon, 97 | name: result.name, 98 | openingHours: result.openingHours, 99 | photos: result.photos, 100 | internationalPhoneNumber: result.internationalPhoneNumber, 101 | priceLevel: result.priceLevel, 102 | rating: result.rating, 103 | scope: result.scope, 104 | url: result.url, 105 | vicinity: result.vicinity, 106 | utcOffset: result.utcOffset, 107 | website: result.website, 108 | reviews: result.reviews, 109 | ); 110 | } 111 | 112 | toPlaceDetailResultMap() { 113 | Map map = HashMap(); 114 | map['placeId'] = placeId; 115 | map['geometry'] = geometry?.toJson(); 116 | map['location'] = geometry?.location.toJson(); 117 | map['formattedAddress'] = formattedAddress; 118 | map['types'] = types?.map((e) => e).toList(); 119 | map['addressComponents'] = 120 | addressComponents?.map((e) => e.toJson()).toList(); 121 | map['adrAddress'] = adrAddress; 122 | map['formattedPhoneNumber'] = formattedPhoneNumber; 123 | map['id'] = id; 124 | map['reference'] = reference; 125 | map['icon'] = icon; 126 | map['name'] = name; 127 | map['openingHours'] = openingHours?.toJson(); 128 | map['photos'] = photos?.map((e) => e.toJson()).toList(); 129 | map['internationalPhoneNumber'] = internationalPhoneNumber; 130 | map['priceLevel'] = priceLevel; 131 | map['rating'] = rating; 132 | map['scope'] = scope; 133 | map['url'] = url; 134 | map['vicinity'] = vicinity; 135 | map['utcOffset'] = utcOffset; 136 | map['website'] = website; 137 | map['reviews'] = reviews?.map((e) => e.toJson()).toList(); 138 | return map; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /lib/providers/autocomplete_search_controller.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/cupertino.dart'; 2 | import 'package:flutter_place_picker/src/autocomplete_search.dart'; 3 | 4 | class SearchBarController extends ChangeNotifier { 5 | late AutoCompleteSearchState _autoCompleteSearch; 6 | 7 | attach(AutoCompleteSearchState searchWidget) { 8 | _autoCompleteSearch = searchWidget; 9 | } 10 | 11 | /// Just clears text. 12 | clear() { 13 | _autoCompleteSearch.clearText(); 14 | } 15 | 16 | /// Clear and remove focus (Dismiss keyboard) 17 | reset() { 18 | _autoCompleteSearch.resetSearchBar(); 19 | } 20 | 21 | clearOverlay() { 22 | _autoCompleteSearch.clearOverlay(); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /lib/providers/place_provider.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/widgets.dart'; 4 | import 'package:geolocator/geolocator.dart'; 5 | import 'package:google_maps_flutter/google_maps_flutter.dart'; 6 | import 'package:flutter_place_picker/models/pick_result.dart'; 7 | import 'package:flutter_place_picker/src/picker.dart'; 8 | import 'package:google_maps_webservice/geocoding.dart'; 9 | import 'package:google_maps_webservice/places.dart'; 10 | import 'package:http/http.dart'; 11 | import 'package:permission_handler/permission_handler.dart'; 12 | import 'package:provider/provider.dart'; 13 | 14 | class PlaceProvider extends ChangeNotifier { 15 | PlaceProvider( 16 | String apiKey, 17 | String? proxyBaseUrl, 18 | Client? httpClient, 19 | Map apiHeaders, 20 | ) { 21 | places = GoogleMapsPlaces( 22 | apiKey: apiKey, 23 | baseUrl: proxyBaseUrl, 24 | httpClient: httpClient, 25 | apiHeaders: apiHeaders as Map?, 26 | ); 27 | 28 | geocoding = GoogleMapsGeocoding( 29 | apiKey: apiKey, 30 | baseUrl: proxyBaseUrl, 31 | httpClient: httpClient, 32 | apiHeaders: apiHeaders as Map?, 33 | ); 34 | } 35 | 36 | static PlaceProvider of(BuildContext context, {bool listen = true}) => 37 | Provider.of(context, listen: listen); 38 | 39 | late GoogleMapsPlaces places; 40 | late GoogleMapsGeocoding geocoding; 41 | String? sessionToken; 42 | bool isOnUpdateLocationCooldown = false; 43 | LocationAccuracy? desiredAccuracy; 44 | bool isAutoCompleteSearching = false; 45 | 46 | Future updateCurrentLocation(bool forceAndroidLocationManager) async { 47 | try { 48 | await Permission.location.request(); 49 | if (await Permission.location.request().isGranted) { 50 | currentPosition = await Geolocator.getCurrentPosition( 51 | desiredAccuracy: desiredAccuracy ?? LocationAccuracy.best); 52 | } else { 53 | currentPosition = null; 54 | } 55 | } catch (e) { 56 | debugPrint(e.toString()); 57 | currentPosition = null; 58 | } 59 | 60 | notifyListeners(); 61 | } 62 | 63 | Position? _currentPoisition; 64 | Position? get currentPosition => _currentPoisition; 65 | set currentPosition(Position? newPosition) { 66 | _currentPoisition = newPosition; 67 | notifyListeners(); 68 | } 69 | 70 | Timer? _debounceTimer; 71 | Timer? get debounceTimer => _debounceTimer; 72 | set debounceTimer(Timer? timer) { 73 | _debounceTimer = timer; 74 | notifyListeners(); 75 | } 76 | 77 | CameraPosition? _previousCameraPosition; 78 | CameraPosition? get prevCameraPosition => _previousCameraPosition; 79 | setPrevCameraPosition(CameraPosition? prePosition) { 80 | _previousCameraPosition = prePosition; 81 | } 82 | 83 | CameraPosition? _currentCameraPosition; 84 | CameraPosition? get cameraPosition => _currentCameraPosition; 85 | setCameraPosition(CameraPosition? newPosition) { 86 | _currentCameraPosition = newPosition; 87 | } 88 | 89 | PickResult? _selectedPlace; 90 | PickResult? get selectedPlace => _selectedPlace; 91 | set selectedPlace(PickResult? result) { 92 | _selectedPlace = result; 93 | notifyListeners(); 94 | } 95 | 96 | SearchingState _placeSearchingState = SearchingState.Idle; 97 | SearchingState get placeSearchingState => _placeSearchingState; 98 | set placeSearchingState(SearchingState newState) { 99 | _placeSearchingState = newState; 100 | notifyListeners(); 101 | } 102 | 103 | GoogleMapController? _mapController; 104 | GoogleMapController? get mapController => _mapController; 105 | set mapController(GoogleMapController? controller) { 106 | _mapController = controller; 107 | notifyListeners(); 108 | } 109 | 110 | PinState _pinState = PinState.Preparing; 111 | PinState get pinState => _pinState; 112 | set pinState(PinState newState) { 113 | _pinState = newState; 114 | notifyListeners(); 115 | } 116 | 117 | bool _isSeachBarFocused = false; 118 | bool get isSearchBarFocused => _isSeachBarFocused; 119 | set isSearchBarFocused(bool focused) { 120 | _isSeachBarFocused = focused; 121 | notifyListeners(); 122 | } 123 | 124 | MapType _mapType = MapType.normal; 125 | MapType get mapType => _mapType; 126 | setMapType(MapType mapType, {bool notify = false}) { 127 | _mapType = mapType; 128 | if (notify) notifyListeners(); 129 | } 130 | 131 | switchMapType() { 132 | _mapType = MapType.values[(_mapType.index + 1) % MapType.values.length]; 133 | if (_mapType == MapType.none) _mapType = MapType.normal; 134 | 135 | notifyListeners(); 136 | } 137 | 138 | String _serverUrl = "https://map.shaqexpress.com/api/"; 139 | String get serverUrl => _serverUrl; 140 | set setServerUrl(String newUrl) { 141 | _serverUrl = newUrl; 142 | 143 | notifyListeners(); 144 | } 145 | } 146 | -------------------------------------------------------------------------------- /lib/providers/search_provider.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:provider/provider.dart'; 3 | 4 | class SearchProvider extends ChangeNotifier { 5 | static SearchProvider of(BuildContext context, {bool listen = true}) => 6 | Provider.of(context, listen: listen); 7 | 8 | String _prevSearchTerm = ""; 9 | String _searchTerm = ""; 10 | 11 | String get prevSearchTerm => _prevSearchTerm; 12 | String get searchTerm => _searchTerm; 13 | 14 | set searchTerm(String newValue) { 15 | _searchTerm = newValue; 16 | notifyListeners(); 17 | } 18 | 19 | set setPrevSearchTerm(String newValue) { 20 | _prevSearchTerm = newValue; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/resources/get_from_server.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:dio/dio.dart'; 3 | 4 | class Get { 5 | late Response response; 6 | late String progress; 7 | Dio dio = Dio(); 8 | 9 | Future fromServer(String url) async { 10 | try { 11 | response = await dio.get( 12 | url, 13 | options: Options( 14 | headers: { 15 | 'Accept': 'application/json', 16 | }, 17 | ), 18 | onReceiveProgress: (int sent, int total) { 19 | String percentage = (sent / total * 100).toStringAsFixed(2); 20 | 21 | progress = "$sent Bytes of $total Bytes - $percentage % uploaded"; 22 | // debugPrint("================$progress"); 23 | }, 24 | ); 25 | if (response.statusCode! >= 200 && response.statusCode! < 400) { 26 | return response.toString(); 27 | } else { 28 | return jsonEncode( 29 | { 30 | "error": true, 31 | "msg": "Error during connection to server.", 32 | }, 33 | ); 34 | } 35 | } catch (e) { 36 | // debugPrint(e.toString()); 37 | return jsonEncode( 38 | { 39 | "error": true, 40 | "msg": 41 | "Oops! Seems you might have an internet connectivity problem, Kindly check your connection." 42 | }, 43 | ); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /lib/resources/post_to_server.dart: -------------------------------------------------------------------------------- 1 | import 'dart:convert'; 2 | import 'package:dio/dio.dart'; 3 | 4 | class Post { 5 | late Response response; 6 | late String progress; 7 | Dio dio = Dio(); 8 | 9 | Future toServer( 10 | String url, 11 | Map data, 12 | ) async { 13 | try { 14 | response = await dio.post( 15 | url, 16 | data: FormData.fromMap(data), 17 | options: Options( 18 | headers: { 19 | 'Accept': 'application/json', 20 | 'Content-Type': 'application/json' 21 | }, 22 | ), 23 | onSendProgress: (int sent, int total) { 24 | String percentage = (sent / total * 100).toStringAsFixed(2); 25 | 26 | progress = "$sent" " Bytes of " "$total Bytes - " + 27 | percentage + 28 | " % uploaded"; 29 | // debugPrint("================$progress"); 30 | }, 31 | ); 32 | // debugPrint("================${response.toString()};"); 33 | // debugPrint("================${url.toString()};"); 34 | if (response.statusCode == 200) { 35 | return response.toString(); 36 | } else { 37 | return jsonEncode( 38 | {"error": true, "msg": "Error during connection to server."}); 39 | } 40 | } catch (e) { 41 | // debugPrint('error from server: $e'); 42 | return jsonEncode({ 43 | "error": true, 44 | "msg": 45 | "Oops! Seems you might have an internet connectivity problem, Kindly check your connection." 46 | }); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /lib/src/autocomplete_search.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | import 'dart:convert'; 3 | import 'package:flutter/material.dart'; 4 | import 'package:provider/provider.dart'; 5 | import 'package:google_maps_webservice/places.dart'; 6 | import 'package:flutter_place_picker/utils/urls.dart'; 7 | import 'package:flutter_place_picker/flutter_place_picker.dart'; 8 | import 'package:flutter_place_picker/models/local_prediction.dart'; 9 | import 'package:flutter_place_picker/widgets/prediction_tile.dart'; 10 | import 'package:flutter_place_picker/providers/place_provider.dart'; 11 | import 'package:flutter_place_picker/resources/post_to_server.dart'; 12 | import 'package:flutter_place_picker/providers/search_provider.dart'; 13 | import 'package:flutter_place_picker/resources/get_from_server.dart'; 14 | import 'package:flutter_place_picker/providers/autocomplete_search_controller.dart'; 15 | 16 | 17 | class AutoCompleteSearch extends StatefulWidget { 18 | const AutoCompleteSearch( 19 | {Key? key, 20 | required this.sessionToken, 21 | required this.onPicked, 22 | required this.onLocalPredictionPicked, 23 | required this.appBarKey, 24 | this.hintText, 25 | this.searchingText = "Searching...", 26 | this.height = 40, 27 | this.contentPadding = EdgeInsets.zero, 28 | this.debounceMilliseconds, 29 | this.onSearchFailed, 30 | required this.searchBarController, 31 | this.autocompleteOffset, 32 | this.autocompleteRadius, 33 | this.autocompleteLanguage, 34 | this.autocompleteComponents, 35 | this.autocompleteTypes, 36 | this.strictBounds, 37 | this.region, 38 | this.initialSearchString, 39 | this.searchForInitialValue, 40 | this.autocompleteOnTrailingWhitespace}) 41 | : super(key: key); 42 | 43 | final String? sessionToken; 44 | final String? hintText; 45 | final String? searchingText; 46 | final double height; 47 | final EdgeInsetsGeometry contentPadding; 48 | final int? debounceMilliseconds; 49 | final ValueChanged onPicked; 50 | final ValueChanged onLocalPredictionPicked; 51 | final ValueChanged? onSearchFailed; 52 | final SearchBarController searchBarController; 53 | final num? autocompleteOffset; 54 | final num? autocompleteRadius; 55 | final String? autocompleteLanguage; 56 | final List? autocompleteTypes; 57 | final List? autocompleteComponents; 58 | final bool? strictBounds; 59 | final String? region; 60 | final GlobalKey appBarKey; 61 | final String? initialSearchString; 62 | final bool? searchForInitialValue; 63 | final bool? autocompleteOnTrailingWhitespace; 64 | 65 | @override 66 | AutoCompleteSearchState createState() => AutoCompleteSearchState(); 67 | } 68 | 69 | class AutoCompleteSearchState extends State { 70 | TextEditingController controller = TextEditingController(); 71 | FocusNode focus = FocusNode(); 72 | OverlayEntry? overlayEntry; 73 | SearchProvider provider = SearchProvider(); 74 | 75 | @override 76 | void initState() { 77 | super.initState(); 78 | if (widget.initialSearchString != null) { 79 | WidgetsBinding.instance.addPostFrameCallback((_) { 80 | controller.text = widget.initialSearchString!; 81 | if (widget.searchForInitialValue!) { 82 | _onSearchInputChange(); 83 | } 84 | }); 85 | } 86 | controller.addListener(_onSearchInputChange); 87 | focus.addListener(_onFocusChanged); 88 | 89 | widget.searchBarController.attach(this); 90 | } 91 | 92 | @override 93 | void dispose() { 94 | controller.removeListener(_onSearchInputChange); 95 | controller.dispose(); 96 | 97 | focus.removeListener(_onFocusChanged); 98 | focus.dispose(); 99 | _clearOverlay(); 100 | 101 | super.dispose(); 102 | } 103 | 104 | @override 105 | Widget build(BuildContext context) { 106 | return ChangeNotifierProvider.value( 107 | value: provider, 108 | child: RoundedFrame( 109 | height: widget.height, 110 | padding: const EdgeInsets.only(right: 10), 111 | color: Theme.of(context).brightness == Brightness.dark 112 | ? Colors.black54 113 | : Colors.white, 114 | borderRadius: BorderRadius.circular(20), 115 | elevation: 8.0, 116 | child: Row( 117 | children: [ 118 | SizedBox(width: 10), 119 | Icon(Icons.search), 120 | SizedBox(width: 10), 121 | Expanded(child: _buildSearchTextField()), 122 | _buildTextClearIcon(), 123 | ], 124 | ), 125 | ), 126 | ); 127 | } 128 | 129 | Widget _buildSearchTextField() { 130 | return TextField( 131 | controller: controller, 132 | focusNode: focus, 133 | decoration: InputDecoration( 134 | hintText: widget.hintText, 135 | border: InputBorder.none, 136 | isDense: true, 137 | contentPadding: widget.contentPadding, 138 | ), 139 | ); 140 | } 141 | 142 | Widget _buildTextClearIcon() { 143 | return Selector( 144 | selector: (_, provider) => provider.searchTerm, 145 | builder: (_, data, __) { 146 | if (data.length > 0) { 147 | return Padding( 148 | padding: const EdgeInsets.only(right: 8.0), 149 | child: GestureDetector( 150 | child: Icon( 151 | Icons.clear, 152 | color: Theme.of(context).brightness == Brightness.dark 153 | ? Colors.white 154 | : Colors.black, 155 | ), 156 | onTap: () { 157 | clearText(); 158 | }, 159 | ), 160 | ); 161 | } else { 162 | return SizedBox(width: 10); 163 | } 164 | }); 165 | } 166 | 167 | _onSearchInputChange() { 168 | if (!mounted) return; 169 | this.provider.searchTerm = controller.text; 170 | 171 | PlaceProvider provider = PlaceProvider.of(context, listen: false); 172 | 173 | if (controller.text.isEmpty) { 174 | provider.debounceTimer?.cancel(); 175 | _searchPlace(controller.text); 176 | return; 177 | } 178 | 179 | if (controller.text.trim() == this.provider.prevSearchTerm.trim()) { 180 | provider.debounceTimer?.cancel(); 181 | return; 182 | } 183 | 184 | if (!widget.autocompleteOnTrailingWhitespace! && 185 | controller.text.substring(controller.text.length - 1) == " ") { 186 | provider.debounceTimer?.cancel(); 187 | return; 188 | } 189 | 190 | if (provider.debounceTimer?.isActive ?? false) { 191 | provider.debounceTimer!.cancel(); 192 | } 193 | 194 | provider.debounceTimer = 195 | Timer(Duration(milliseconds: widget.debounceMilliseconds!), () { 196 | _searchPlace(controller.text.trim()); 197 | }); 198 | } 199 | 200 | _onFocusChanged() { 201 | PlaceProvider provider = PlaceProvider.of(context, listen: false); 202 | provider.isSearchBarFocused = focus.hasFocus; 203 | provider.debounceTimer?.cancel(); 204 | provider.placeSearchingState = SearchingState.Idle; 205 | } 206 | 207 | _searchPlace(String searchTerm) { 208 | this.provider.setPrevSearchTerm = searchTerm; 209 | 210 | _clearOverlay(); 211 | 212 | if (searchTerm.length < 1) return; 213 | 214 | _displayOverlay(_buildSearchingOverlay()); 215 | 216 | _performAutoCompleteSearch(searchTerm); 217 | } 218 | 219 | _clearOverlay() { 220 | if (overlayEntry != null) { 221 | overlayEntry!.remove(); 222 | overlayEntry = null; 223 | } 224 | } 225 | 226 | _displayOverlay(Widget overlayChild) { 227 | _clearOverlay(); 228 | 229 | final RenderBox? appBarRenderBox = 230 | widget.appBarKey.currentContext!.findRenderObject() as RenderBox?; 231 | final screenWidth = MediaQuery.of(context).size.width; 232 | 233 | overlayEntry = OverlayEntry( 234 | builder: (context) => Positioned( 235 | top: appBarRenderBox!.size.height, 236 | left: screenWidth * 0.025, 237 | right: screenWidth * 0.025, 238 | child: Material( 239 | elevation: 4.0, 240 | child: overlayChild, 241 | ), 242 | ), 243 | ); 244 | 245 | Overlay.of(context).insert(overlayEntry!); 246 | } 247 | 248 | Widget _buildSearchingOverlay() { 249 | return Container( 250 | padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24), 251 | child: Row( 252 | children: [ 253 | SizedBox( 254 | height: 24, 255 | width: 24, 256 | child: CircularProgressIndicator(), 257 | ), 258 | SizedBox(width: 24), 259 | Expanded( 260 | child: Text( 261 | widget.searchingText ?? "Searching...", 262 | style: TextStyle(fontSize: 16), 263 | ), 264 | ) 265 | ], 266 | ), 267 | ); 268 | } 269 | 270 | Widget _buildPredictionOverlay({ 271 | List? predictions, 272 | List? localPrediction, 273 | }) { 274 | return Container( 275 | padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 24), 276 | constraints: BoxConstraints( 277 | maxHeight: MediaQuery.of(context).size.height * 0.8, 278 | ), 279 | child: SingleChildScrollView( 280 | child: Column( 281 | children: (predictions ?? localPrediction ?? []) 282 | .map( 283 | (p) => PredictionTile( 284 | prediction: predictions == null ? null : p as Prediction, 285 | localPrediction: 286 | localPrediction == null ? null : p as LocalPrediction, 287 | onTap: (Prediction selectedPrediction) { 288 | resetSearchBar(); 289 | widget.onPicked(selectedPrediction); 290 | }, 291 | onLocPreTap: (LocalPrediction selectedPrediction) { 292 | resetSearchBar(); 293 | widget.onLocalPredictionPicked(selectedPrediction); 294 | }, 295 | ), 296 | ) 297 | .toList(), 298 | ), 299 | )); 300 | } 301 | 302 | _performAutoCompleteSearch(String searchTerm) async { 303 | PlaceProvider provider = PlaceProvider.of(context, listen: false); 304 | 305 | if (searchTerm.isNotEmpty) { 306 | //! SEARCH FROM BACKEND 307 | 308 | String resp = await Get() 309 | .fromServer("${provider.serverUrl}${Urls.localMapSearch}$searchTerm"); 310 | 311 | try { 312 | dynamic jRes = jsonDecode(resp); 313 | if (jRes["error"]) { 314 | widget.onSearchFailed!(jRes["msg"]); 315 | return; 316 | } else { 317 | if (jRes["data"].length > 0) { 318 | //! has data 319 | List localPrediction = List.from( 320 | jRes['data'] 321 | .map((e) => LocalPrediction.fromMap(e, searchTerm)) 322 | .toList()); 323 | return _displayOverlay( 324 | _buildPredictionOverlay(localPrediction: localPrediction)); 325 | } else { 326 | final PlacesAutocompleteResponse response = 327 | await provider.places.autocomplete( 328 | searchTerm, 329 | sessionToken: widget.sessionToken, 330 | location: provider.currentPosition == null 331 | ? null 332 | : Location( 333 | lat: provider.currentPosition!.latitude, 334 | lng: provider.currentPosition!.longitude), 335 | offset: widget.autocompleteOffset, 336 | radius: widget.autocompleteRadius, 337 | language: widget.autocompleteLanguage, 338 | types: widget.autocompleteTypes ?? const [], 339 | components: widget.autocompleteComponents ?? const [], 340 | strictbounds: widget.strictBounds ?? false, 341 | region: widget.region, 342 | ); 343 | 344 | if (response.errorMessage?.isNotEmpty == true || 345 | response.status == "REQUEST_DENIED") { 346 | if (widget.onSearchFailed != null) { 347 | widget.onSearchFailed!(response.status); 348 | } 349 | return; 350 | } 351 | 352 | //! save Predictions to local server...... 353 | Post().toServer("${provider.serverUrl}${Urls.savePlaceId}", { 354 | "places": response.predictions 355 | .map((e) => 356 | {'description': e.description, 'place_id': e.placeId}) 357 | .toList(), 358 | }); 359 | 360 | _displayOverlay( 361 | _buildPredictionOverlay(predictions: response.predictions)); 362 | } 363 | } 364 | } catch (e) { 365 | debugPrint(e.toString()); 366 | return widget.onSearchFailed!(e.toString()); 367 | } 368 | } 369 | } 370 | 371 | clearText() { 372 | provider.searchTerm = ""; 373 | controller.clear(); 374 | } 375 | 376 | resetSearchBar() { 377 | clearText(); 378 | focus.unfocus(); 379 | } 380 | 381 | clearOverlay() { 382 | _clearOverlay(); 383 | } 384 | } 385 | -------------------------------------------------------------------------------- /lib/utils/urls.dart: -------------------------------------------------------------------------------- 1 | class Urls { 2 | static String localMapSearch = "local-map/search?search_query="; 3 | static String savePlaceId = "local-map/save-places-id"; 4 | static String saveLocalMap = "local-map/save"; 5 | } 6 | -------------------------------------------------------------------------------- /lib/utils/uuid.dart: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 2 | // for details. All rights reserved. Use of this source code is governed by a 3 | // BSD-style license that can be found in the LICENSE file. 4 | 5 | /// A UUID generator library. 6 | library uuid; 7 | 8 | import 'dart:math' show Random; 9 | 10 | /// A UUID generator. 11 | /// 12 | /// This will generate unique IDs in the format: 13 | /// 14 | /// f47ac10b-58cc-4372-a567-0e02b2c3d479 15 | /// 16 | /// The generated uuids are 128 bit numbers encoded in a specific string format. 17 | /// For more information, see 18 | /// [en.wikipedia.org/wiki/Universally_unique_identifier](http://en.wikipedia.org/wiki/Universally_unique_identifier). 19 | class Uuid { 20 | final Random _random = new Random(); 21 | 22 | /// Generate a version 4 (random) uuid. This is a uuid scheme that only uses 23 | /// random numbers as the source of the generated uuid. 24 | String generateV4() { 25 | // Generate xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx / 8-4-4-4-12. 26 | int special = 8 + _random.nextInt(4); 27 | 28 | return '${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}-' 29 | '${_bitsDigits(16, 4)}-' 30 | '4${_bitsDigits(12, 3)}-' 31 | '${_printDigits(special, 1)}${_bitsDigits(12, 3)}-' 32 | '${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}${_bitsDigits(16, 4)}'; 33 | } 34 | 35 | String _bitsDigits(int bitCount, int digitCount) => 36 | _printDigits(_generateBits(bitCount), digitCount); 37 | 38 | int _generateBits(int bitCount) => _random.nextInt(1 << bitCount); 39 | 40 | String _printDigits(int value, int count) => 41 | value.toRadixString(16).padLeft(count, '0'); 42 | } 43 | -------------------------------------------------------------------------------- /lib/widgets/animated_pin.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class AnimatedPin extends StatefulWidget { 4 | AnimatedPin({ 5 | Key? key, 6 | this.child, 7 | }); 8 | 9 | final Widget? child; 10 | 11 | @override 12 | _AnimatedPinState createState() => _AnimatedPinState(); 13 | } 14 | 15 | class _AnimatedPinState extends State 16 | with TickerProviderStateMixin { 17 | late AnimationController _controller; 18 | 19 | @override 20 | void initState() { 21 | super.initState(); 22 | _controller = AnimationController( 23 | duration: const Duration(seconds: 1), 24 | vsync: this, 25 | )..repeat(); 26 | } 27 | 28 | @override 29 | void dispose() { 30 | _controller.dispose(); 31 | super.dispose(); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return JumpingContainer(controller: _controller, child: widget.child); 37 | } 38 | } 39 | 40 | class JumpingContainer extends AnimatedWidget { 41 | const JumpingContainer({ 42 | Key? key, 43 | required AnimationController controller, 44 | this.child, 45 | }) : super(key: key, listenable: controller); 46 | 47 | final Widget? child; 48 | 49 | Animation get _progress => listenable as Animation; 50 | 51 | @override 52 | Widget build(BuildContext context) { 53 | return Transform.translate( 54 | offset: Offset(0, -10 + _progress.value * 10), 55 | child: child, 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/widgets/floating_card.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_place_picker/widgets/rounded_frame.dart'; 3 | 4 | class FloatingCard extends StatelessWidget { 5 | const FloatingCard({ 6 | Key? key, 7 | this.topPosition, 8 | this.leftPosition, 9 | this.rightPosition, 10 | this.bottomPosition, 11 | this.width, 12 | this.height, 13 | this.borderRadius = BorderRadius.zero, 14 | this.elevation = 0.0, 15 | this.color, 16 | this.child, 17 | }) : super(key: key); 18 | 19 | final double? topPosition; 20 | final double? leftPosition; 21 | final double? bottomPosition; 22 | final double? rightPosition; 23 | final double? width; 24 | final double? height; 25 | final BorderRadius borderRadius; 26 | final double elevation; 27 | final Color? color; 28 | final Widget? child; 29 | 30 | @override 31 | Widget build(BuildContext context) { 32 | return Positioned( 33 | top: topPosition, 34 | left: leftPosition, 35 | right: rightPosition, 36 | bottom: bottomPosition, 37 | child: RoundedFrame( 38 | width: width, 39 | height: height, 40 | borderRadius: borderRadius, 41 | elevation: elevation, 42 | color: color, 43 | child: child, 44 | ), 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /lib/widgets/prediction_tile.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:google_maps_webservice/places.dart'; 3 | import 'package:flutter_place_picker/models/local_prediction.dart'; 4 | 5 | class PredictionTile extends StatelessWidget { 6 | final Prediction? prediction; 7 | final LocalPrediction? localPrediction; 8 | final ValueChanged? onTap; 9 | final ValueChanged? onLocPreTap; 10 | 11 | PredictionTile( 12 | {this.localPrediction, this.prediction, this.onLocPreTap, this.onTap}); 13 | 14 | @override 15 | Widget build(BuildContext context) { 16 | return ListTile( 17 | leading: Icon(Icons.location_on), 18 | title: RichText( 19 | text: TextSpan( 20 | children: _buildPredictionText(context), 21 | ), 22 | ), 23 | onTap: () { 24 | if (onTap != null) { 25 | if (prediction != null) onTap!(prediction!); 26 | if (localPrediction != null) onLocPreTap!(localPrediction!); 27 | } 28 | }, 29 | ); 30 | } 31 | 32 | List _buildPredictionText(BuildContext context) { 33 | final List result = []; 34 | final textColor = Theme.of(context).textTheme.bodyMedium!.color; 35 | 36 | if (prediction != null && prediction!.matchedSubstrings.length > 0) { 37 | MatchedSubstring matchedSubString = prediction!.matchedSubstrings[0]; 38 | // There is no matched string at the beginning. 39 | if (matchedSubString.offset > 0) { 40 | result.add( 41 | TextSpan( 42 | text: (prediction?.description ?? localPrediction?.formattedAddress) 43 | ?.substring(0, matchedSubString.offset as int?), 44 | style: TextStyle( 45 | color: textColor, fontSize: 16, fontWeight: FontWeight.w300), 46 | ), 47 | ); 48 | } 49 | 50 | // Matched strings. 51 | result.add( 52 | TextSpan( 53 | text: (prediction?.description ?? localPrediction?.formattedAddress) 54 | ?.substring(matchedSubString.offset as int, 55 | matchedSubString.offset + matchedSubString.length as int?), 56 | style: TextStyle( 57 | color: textColor, fontSize: 16, fontWeight: FontWeight.w500), 58 | ), 59 | ); 60 | 61 | // Other strings. 62 | if (matchedSubString.offset + matchedSubString.length < 63 | ((prediction?.description?.length ?? 64 | localPrediction?.formattedAddress?.length) ?? 65 | 0)) { 66 | result.add( 67 | TextSpan( 68 | text: (prediction?.description ?? localPrediction?.formattedAddress) 69 | ?.substring( 70 | matchedSubString.offset + matchedSubString.length as int), 71 | style: TextStyle( 72 | color: textColor, fontSize: 16, fontWeight: FontWeight.w300), 73 | ), 74 | ); 75 | } 76 | // If there is no matched strings, but there are predicts. (Not sure if this happens though) 77 | } else { 78 | result.add( 79 | TextSpan( 80 | text: (prediction?.description ?? localPrediction?.formattedAddress), 81 | style: TextStyle( 82 | color: textColor, fontSize: 16, fontWeight: FontWeight.w300), 83 | ), 84 | ); 85 | } 86 | 87 | return result; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /lib/widgets/rounded_frame.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | class RoundedFrame extends StatelessWidget { 4 | const RoundedFrame({ 5 | Key? key, 6 | this.margin, 7 | this.padding, 8 | this.width, 9 | this.height, 10 | this.child, 11 | this.color, 12 | this.borderRadius = BorderRadius.zero, 13 | this.borderColor = Colors.transparent, 14 | this.elevation = 0.0, 15 | this.materialType, 16 | }) : super(key: key); 17 | 18 | final EdgeInsetsGeometry? margin; 19 | final EdgeInsetsGeometry? padding; 20 | final double? width; 21 | final double? height; 22 | final Widget? child; 23 | final Color? color; 24 | final Color borderColor; 25 | final BorderRadius borderRadius; 26 | final double elevation; 27 | final MaterialType? materialType; 28 | 29 | @override 30 | Widget build(BuildContext context) { 31 | return Container( 32 | width: width, 33 | height: height, 34 | margin: margin, 35 | padding: padding, 36 | child: Material( 37 | type: color == Colors.transparent 38 | ? MaterialType.transparency 39 | : materialType ?? MaterialType.canvas, 40 | color: color, 41 | shape: RoundedRectangleBorder( 42 | borderRadius: borderRadius, side: BorderSide(color: borderColor)), 43 | elevation: elevation, 44 | child: ClipRRect( 45 | borderRadius: borderRadius, 46 | child: child, 47 | ), 48 | ), 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /preview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/preview.gif -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.10.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.2.1" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.17.0" 44 | dio: 45 | dependency: "direct main" 46 | description: 47 | name: dio 48 | sha256: "2644a9e0965a7aa3deb09cb8ce4081db4450c178f472818c8cd34216a3070d7b" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "5.0.2" 52 | fake_async: 53 | dependency: transitive 54 | description: 55 | name: fake_async 56 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 57 | url: "https://pub.dev" 58 | source: hosted 59 | version: "1.3.1" 60 | ffi: 61 | dependency: transitive 62 | description: 63 | name: ffi 64 | sha256: a38574032c5f1dd06c4aee541789906c12ccaab8ba01446e800d9c5b79c4a978 65 | url: "https://pub.dev" 66 | source: hosted 67 | version: "2.0.1" 68 | flutter: 69 | dependency: "direct main" 70 | description: flutter 71 | source: sdk 72 | version: "0.0.0" 73 | flutter_plugin_android_lifecycle: 74 | dependency: transitive 75 | description: 76 | name: flutter_plugin_android_lifecycle 77 | sha256: "60fc7b78455b94e6de2333d2f95196d32cf5c22f4b0b0520a628804cb463503b" 78 | url: "https://pub.dev" 79 | source: hosted 80 | version: "2.0.7" 81 | flutter_test: 82 | dependency: "direct dev" 83 | description: flutter 84 | source: sdk 85 | version: "0.0.0" 86 | flutter_web_plugins: 87 | dependency: transitive 88 | description: flutter 89 | source: sdk 90 | version: "0.0.0" 91 | geocoding: 92 | dependency: "direct main" 93 | description: 94 | name: geocoding 95 | sha256: b34c0501bbbaf3190b85bef3078b27cf66c28a8915c6d3af50d67f356aa7da31 96 | url: "https://pub.dev" 97 | source: hosted 98 | version: "2.1.0" 99 | geocoding_android: 100 | dependency: transitive 101 | description: 102 | name: geocoding_android 103 | sha256: "5a1fc0cec9b0497b44ca31c1fa8d1c891f3aded1053e6bb2eac075d3bd1bf046" 104 | url: "https://pub.dev" 105 | source: hosted 106 | version: "2.1.0" 107 | geocoding_ios: 108 | dependency: transitive 109 | description: 110 | name: geocoding_ios 111 | sha256: c85495ce8fb34e4fbd2dd8fc5f79263d622d9f88c4af948c965daf6b27a7f3a1 112 | url: "https://pub.dev" 113 | source: hosted 114 | version: "2.1.0" 115 | geocoding_platform_interface: 116 | dependency: transitive 117 | description: 118 | name: geocoding_platform_interface 119 | sha256: "8848605d307d844d89937cdb4b8ad7dfa880552078f310fa24d8a460f6dddab4" 120 | url: "https://pub.dev" 121 | source: hosted 122 | version: "2.0.1" 123 | geolocator: 124 | dependency: "direct main" 125 | description: 126 | name: geolocator 127 | sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" 128 | url: "https://pub.dev" 129 | source: hosted 130 | version: "9.0.2" 131 | geolocator_android: 132 | dependency: transitive 133 | description: 134 | name: geolocator_android 135 | sha256: "2ba24690aee0a3e1b6b7bd47c2711a50c874e95e4c758346589d35194adf6d6a" 136 | url: "https://pub.dev" 137 | source: hosted 138 | version: "4.1.7" 139 | geolocator_apple: 140 | dependency: transitive 141 | description: 142 | name: geolocator_apple 143 | sha256: "1b17544d250bbfebd2f36157f9ce094b0b07967441c1010243d6ea04f6f5bfe8" 144 | url: "https://pub.dev" 145 | source: hosted 146 | version: "2.2.1" 147 | geolocator_platform_interface: 148 | dependency: transitive 149 | description: 150 | name: geolocator_platform_interface 151 | sha256: "8c10ba5c825abdcc337ba918fbc1d3a5a2b006affe6ba610e3143cd32f54388d" 152 | url: "https://pub.dev" 153 | source: hosted 154 | version: "4.0.6" 155 | geolocator_web: 156 | dependency: transitive 157 | description: 158 | name: geolocator_web 159 | sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 160 | url: "https://pub.dev" 161 | source: hosted 162 | version: "2.1.6" 163 | geolocator_windows: 164 | dependency: transitive 165 | description: 166 | name: geolocator_windows 167 | sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d 168 | url: "https://pub.dev" 169 | source: hosted 170 | version: "0.1.1" 171 | google_api_headers: 172 | dependency: "direct main" 173 | description: 174 | name: google_api_headers 175 | sha256: ac6f4e27e35c9eb4fbe8ce4ce7380e651d3a7bee3ad4c2ff30e67aaa73f005d3 176 | url: "https://pub.dev" 177 | source: hosted 178 | version: "1.5.0+1" 179 | google_maps_flutter: 180 | dependency: "direct main" 181 | description: 182 | name: google_maps_flutter 183 | sha256: "24392ef192f3b00bcd93151375676805a9933574423a5bd5509a0ead2e8a4215" 184 | url: "https://pub.dev" 185 | source: hosted 186 | version: "2.2.5" 187 | google_maps_flutter_android: 188 | dependency: transitive 189 | description: 190 | name: google_maps_flutter_android 191 | sha256: "9fd11f2ee960f8a10be95b64f261b1c3521e1d4c9f313f5547123b72ac1db507" 192 | url: "https://pub.dev" 193 | source: hosted 194 | version: "2.1.10" 195 | google_maps_flutter_ios: 196 | dependency: transitive 197 | description: 198 | name: google_maps_flutter_ios 199 | sha256: "71213e497600e0c67cf7a096f643e58a72ed36334456c32c7ae0a6b4698018df" 200 | url: "https://pub.dev" 201 | source: hosted 202 | version: "2.1.11" 203 | google_maps_flutter_platform_interface: 204 | dependency: transitive 205 | description: 206 | name: google_maps_flutter_platform_interface 207 | sha256: "0a91acaa7ab6a438f428efe49f145a2b48f18ff039301ee2232696e18bf78784" 208 | url: "https://pub.dev" 209 | source: hosted 210 | version: "2.2.2" 211 | google_maps_webservice: 212 | dependency: "direct main" 213 | description: 214 | name: google_maps_webservice 215 | sha256: d0ae4e4508afd74a3f051565261a3cdbae59db29448f9b6e6beb5674545e1eb7 216 | url: "https://pub.dev" 217 | source: hosted 218 | version: "0.0.20-nullsafety.5" 219 | http: 220 | dependency: "direct main" 221 | description: 222 | name: http 223 | sha256: "6aa2946395183537c8b880962d935877325d6a09a2867c3970c05c0fed6ac482" 224 | url: "https://pub.dev" 225 | source: hosted 226 | version: "0.13.5" 227 | http_parser: 228 | dependency: transitive 229 | description: 230 | name: http_parser 231 | sha256: db3060f22889f3d9d55f6a217565486737037eec3609f7f3eca4d0c67ee0d8a0 232 | url: "https://pub.dev" 233 | source: hosted 234 | version: "4.0.1" 235 | js: 236 | dependency: transitive 237 | description: 238 | name: js 239 | sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" 240 | url: "https://pub.dev" 241 | source: hosted 242 | version: "0.6.5" 243 | json_annotation: 244 | dependency: transitive 245 | description: 246 | name: json_annotation 247 | sha256: cb314f00b2488de7bc575207e54402cd2f92363f333a7933fd1b0631af226baa 248 | url: "https://pub.dev" 249 | source: hosted 250 | version: "4.6.0" 251 | matcher: 252 | dependency: transitive 253 | description: 254 | name: matcher 255 | sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" 256 | url: "https://pub.dev" 257 | source: hosted 258 | version: "0.12.13" 259 | material_color_utilities: 260 | dependency: transitive 261 | description: 262 | name: material_color_utilities 263 | sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 264 | url: "https://pub.dev" 265 | source: hosted 266 | version: "0.2.0" 267 | meta: 268 | dependency: transitive 269 | description: 270 | name: meta 271 | sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" 272 | url: "https://pub.dev" 273 | source: hosted 274 | version: "1.8.0" 275 | nested: 276 | dependency: transitive 277 | description: 278 | name: nested 279 | sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" 280 | url: "https://pub.dev" 281 | source: hosted 282 | version: "1.0.0" 283 | package_info_plus: 284 | dependency: transitive 285 | description: 286 | name: package_info_plus 287 | sha256: "8df5ab0a481d7dc20c0e63809e90a588e496d276ba53358afc4c4443d0a00697" 288 | url: "https://pub.dev" 289 | source: hosted 290 | version: "3.0.3" 291 | package_info_plus_platform_interface: 292 | dependency: transitive 293 | description: 294 | name: package_info_plus_platform_interface 295 | sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" 296 | url: "https://pub.dev" 297 | source: hosted 298 | version: "2.0.1" 299 | path: 300 | dependency: transitive 301 | description: 302 | name: path 303 | sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b 304 | url: "https://pub.dev" 305 | source: hosted 306 | version: "1.8.2" 307 | permission_handler: 308 | dependency: "direct main" 309 | description: 310 | name: permission_handler 311 | sha256: "33c6a1253d1f95fd06fa74b65b7ba907ae9811f9d5c1d3150e51417d04b8d6a8" 312 | url: "https://pub.dev" 313 | source: hosted 314 | version: "10.2.0" 315 | permission_handler_android: 316 | dependency: transitive 317 | description: 318 | name: permission_handler_android 319 | sha256: "8028362b40c4a45298f1cbfccd227c8dd6caf0e27088a69f2ba2ab15464159e2" 320 | url: "https://pub.dev" 321 | source: hosted 322 | version: "10.2.0" 323 | permission_handler_apple: 324 | dependency: transitive 325 | description: 326 | name: permission_handler_apple 327 | sha256: "9c370ef6a18b1c4b2f7f35944d644a56aa23576f23abee654cf73968de93f163" 328 | url: "https://pub.dev" 329 | source: hosted 330 | version: "9.0.7" 331 | permission_handler_platform_interface: 332 | dependency: transitive 333 | description: 334 | name: permission_handler_platform_interface 335 | sha256: "68abbc472002b5e6dfce47fe9898c6b7d8328d58b5d2524f75e277c07a97eb84" 336 | url: "https://pub.dev" 337 | source: hosted 338 | version: "3.9.0" 339 | permission_handler_windows: 340 | dependency: transitive 341 | description: 342 | name: permission_handler_windows 343 | sha256: f67cab14b4328574938ecea2db3475dad7af7ead6afab6338772c5f88963e38b 344 | url: "https://pub.dev" 345 | source: hosted 346 | version: "0.1.2" 347 | plugin_platform_interface: 348 | dependency: transitive 349 | description: 350 | name: plugin_platform_interface 351 | sha256: "075f927ebbab4262ace8d0b283929ac5410c0ac4e7fc123c76429564facfb757" 352 | url: "https://pub.dev" 353 | source: hosted 354 | version: "2.1.2" 355 | provider: 356 | dependency: "direct main" 357 | description: 358 | name: provider 359 | sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f 360 | url: "https://pub.dev" 361 | source: hosted 362 | version: "6.0.5" 363 | sky_engine: 364 | dependency: transitive 365 | description: flutter 366 | source: sdk 367 | version: "0.0.99" 368 | source_span: 369 | dependency: transitive 370 | description: 371 | name: source_span 372 | sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 373 | url: "https://pub.dev" 374 | source: hosted 375 | version: "1.9.1" 376 | stack_trace: 377 | dependency: transitive 378 | description: 379 | name: stack_trace 380 | sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 381 | url: "https://pub.dev" 382 | source: hosted 383 | version: "1.11.0" 384 | stream_channel: 385 | dependency: transitive 386 | description: 387 | name: stream_channel 388 | sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" 389 | url: "https://pub.dev" 390 | source: hosted 391 | version: "2.1.1" 392 | stream_transform: 393 | dependency: transitive 394 | description: 395 | name: stream_transform 396 | sha256: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e 397 | url: "https://pub.dev" 398 | source: hosted 399 | version: "2.0.0" 400 | string_scanner: 401 | dependency: transitive 402 | description: 403 | name: string_scanner 404 | sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" 405 | url: "https://pub.dev" 406 | source: hosted 407 | version: "1.2.0" 408 | term_glyph: 409 | dependency: transitive 410 | description: 411 | name: term_glyph 412 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 413 | url: "https://pub.dev" 414 | source: hosted 415 | version: "1.2.1" 416 | test_api: 417 | dependency: transitive 418 | description: 419 | name: test_api 420 | sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 421 | url: "https://pub.dev" 422 | source: hosted 423 | version: "0.4.16" 424 | tuple: 425 | dependency: "direct main" 426 | description: 427 | name: tuple 428 | sha256: "0ea99cd2f9352b2586583ab2ce6489d1f95a5f6de6fb9492faaf97ae2060f0aa" 429 | url: "https://pub.dev" 430 | source: hosted 431 | version: "2.0.1" 432 | typed_data: 433 | dependency: transitive 434 | description: 435 | name: typed_data 436 | sha256: "26f87ade979c47a150c9eaab93ccd2bebe70a27dc0b4b29517f2904f04eb11a5" 437 | url: "https://pub.dev" 438 | source: hosted 439 | version: "1.3.1" 440 | vector_math: 441 | dependency: transitive 442 | description: 443 | name: vector_math 444 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 445 | url: "https://pub.dev" 446 | source: hosted 447 | version: "2.1.4" 448 | win32: 449 | dependency: transitive 450 | description: 451 | name: win32 452 | sha256: "6b75ac2ddd42f5c226fdaf4498a2b04071c06f1f2b8f7ab1c3f77cc7f2285ff1" 453 | url: "https://pub.dev" 454 | source: hosted 455 | version: "2.7.0" 456 | sdks: 457 | dart: ">=2.18.0 <3.0.0" 458 | flutter: ">=3.0.0" 459 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_place_picker 2 | description: A Flutter plugin which provides 'Picking Places' using OpenStreet, Here Maps and Google Maps. 3 | version: 0.0.1-dev.5 4 | homepage: https://github.com/saytoonz/flutter_place_picker 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | google_maps_flutter: ^2.2.5 14 | geolocator: ^9.0.2 15 | permission_handler: ^10.2.0 16 | provider: ^6.0.5 17 | google_maps_webservice: ^0.0.20-nullsafety.5 18 | google_api_headers: ^1.5.0+1 19 | tuple: ^2.0.1 20 | dio: ^5.0.2 21 | http: ^0.13.5 22 | geocoding: ^2.1.0 23 | 24 | dev_dependencies: 25 | flutter_test: 26 | sdk: flutter 27 | 28 | flutter: 29 | -------------------------------------------------------------------------------- /screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/saytoonz/flutter_place_picker/2a7bae981de4fa57403f0bfec2983e8c1edeb5d6/screenshot2.png -------------------------------------------------------------------------------- /test/flutter_place_picker_test.dart: -------------------------------------------------------------------------------- 1 | void main() {} 2 | --------------------------------------------------------------------------------