├── .github ├── CODEOWNERS └── workflows │ └── flutter.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_map_location_example │ │ │ │ │ └── MainActivity.kt │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── settings_aar.gradle ├── custom.png ├── default.png ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── 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 │ ├── pages │ │ ├── controller.dart │ │ ├── custom.dart │ │ └── default.dart │ └── widgets │ │ └── drawer.dart ├── pubspec.yaml └── test │ ├── main_test.dart │ └── pages │ ├── controller_test.dart │ └── custom_test.dart ├── lib ├── flutter_map_location.dart └── src │ ├── location_controller.dart │ ├── location_layer.dart │ ├── location_marker.dart │ ├── location_options.dart │ ├── location_plugin.dart │ └── types.dart ├── pubspec.yaml └── test └── app_test.dart /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @Xennis 2 | -------------------------------------------------------------------------------- /.github/workflows/flutter.yml: -------------------------------------------------------------------------------- 1 | name: Flutter 2 | on: [push, pull_request] 3 | jobs: 4 | check: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Checkout 8 | uses: actions/checkout@v2 9 | - name: Setup Flutter 10 | uses: subosito/flutter-action@v1 11 | with: 12 | channel: 'beta' 13 | - name: Install dependencies 14 | run: flutter pub get 15 | - name: Check format 16 | run: flutter format --set-exit-if-changed . 17 | - name: Run linter 18 | run: flutter analyze . 19 | - name: Run tests 20 | run: flutter test . 21 | - name: Run publish dry-run 22 | run: flutter pub publish --dry-run 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .metadata 2 | pubspec.lock 3 | *.iml 4 | 5 | # Miscellaneous 6 | *.class 7 | *.log 8 | *.pyc 9 | *.swp 10 | .DS_Store 11 | .atom/ 12 | .buildlog/ 13 | .history 14 | .svn/ 15 | 16 | # IntelliJ related 17 | *.iml 18 | *.ipr 19 | *.iws 20 | .idea/ 21 | 22 | # The .vscode folder contains launch configuration and tasks you configure in 23 | # VS Code which you may wish to be included in version control, so this line 24 | # is commented out by default. 25 | #.vscode/ 26 | 27 | # Flutter/Dart/Pub related 28 | **/doc/api/ 29 | .dart_tool/ 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .packages 33 | .pub-cache/ 34 | .pub/ 35 | build/ 36 | 37 | # Android related 38 | **/android/**/gradle-wrapper.jar 39 | **/android/.gradle 40 | **/android/captures/ 41 | **/android/gradlew 42 | **/android/gradlew.bat 43 | **/android/local.properties 44 | **/android/**/GeneratedPluginRegistrant.java 45 | 46 | # iOS/XCode related 47 | **/ios/**/*.mode1v3 48 | **/ios/**/*.mode2v3 49 | **/ios/**/*.moved-aside 50 | **/ios/**/*.pbxuser 51 | **/ios/**/*.perspectivev3 52 | **/ios/**/*sync/ 53 | **/ios/**/.sconsign.dblite 54 | **/ios/**/.tags* 55 | **/ios/**/.vagrant/ 56 | **/ios/**/DerivedData/ 57 | **/ios/**/Icon? 58 | **/ios/**/Pods/ 59 | **/ios/**/.symlinks/ 60 | **/ios/**/profile 61 | **/ios/**/xcuserdata 62 | **/ios/.generated/ 63 | **/ios/Flutter/App.framework 64 | **/ios/Flutter/Flutter.framework 65 | **/ios/Flutter/Flutter.podspec 66 | **/ios/Flutter/Generated.xcconfig 67 | **/ios/Flutter/app.flx 68 | **/ios/Flutter/app.zip 69 | **/ios/Flutter/flutter_assets/ 70 | **/ios/Flutter/flutter_export_environment.sh 71 | **/ios/ServiceDefinitions.json 72 | **/ios/Runner/GeneratedPluginRegistrant.* 73 | 74 | # Exceptions to above rules. 75 | !**/ios/**/default.mode1v3 76 | !**/ios/**/default.mode2v3 77 | !**/ios/**/default.pbxuser 78 | !**/ios/**/default.perspectivev3 79 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 80 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.12.0 2 | 3 | * Update flutter_map to support null safety, map rotation and latlong2 (#66) 4 | * Add null safety (#66) 5 | * Add map rotation support (#66) 6 | * Use latlong2 package instead of latlong (#66) 7 | 8 | Thanks to TheOneWithTheBraid for the contribution. 9 | 10 | ## 0.11.0 11 | 12 | * BREAKING CHANGE: Plugin option `updateIntervalMs` of type `int` was removed. Instead the option `updateInterval` of type `Duration` was added. Example: Replace `updateIntervalMs: 1000` by `updateInterval: Duration(seconds: 1)`. 13 | * Update flutter_compass to remove indirect rxdart dependency 14 | 15 | ## 0.10.0 16 | 17 | * Switch from `location` to `geolocator` package (#54) 18 | 19 | Thanks to TheOneWithTheBraid for the contribution. 20 | 21 | ## 0.9.0 22 | 23 | * Add `initiallyRequest` option to set if location should initially requested (#38) 24 | 25 | Thanks to TheOneWithTheBraid for the contribution. 26 | 27 | ## 0.8.0 28 | 29 | * BREAKING CHANGE: Integrated the marker layer into the plugin. The option `markers` is removed. A `MarkerLayerOptions` outside of the plugin is not needed anymore. See update example for usage. 30 | 31 | ## 0.7.1+2 32 | 33 | * Update dependencies 34 | 35 | ## 0.7.1+1 36 | 37 | * Update dependencies 38 | 39 | ## 0.7.1 40 | 41 | * Fix location marker is centered correctly (#29 by @sjmallon) 42 | 43 | ## 0.7.0+2 44 | 45 | * Update dependencies 46 | 47 | ## 0.7.0+1 48 | 49 | * Update dependencies 50 | 51 | ## 0.7.0 52 | 53 | * Show larger circle for inaccurate location. 54 | * Show heading for accurate location only. 55 | * Add possiblity to change marker icon depending on the location accuracy. 56 | * BREAKING CHANGE: All options return the type `LatLngData` instead of `LatLng`. 57 | 58 | ## 0.6.0 59 | 60 | * Update flutter_compass to allow usage of geomagnetic rotation sensor as fallback on Android. 61 | 62 | ## 0.5.0 63 | 64 | * First public development release. 65 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Xennis 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 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | **The plugin is discontinued.** Feel free to fork it or checkout [similar plugins](https://flutter-map.vercel.app/plugins/list). 2 | 3 | # Flutter Map – Location plugin 4 | 5 | [![Flutter](https://github.com/Xennis/flutter_map_location/workflows/Flutter/badge.svg?branch=main&event=push)](https://github.com/Xennis/flutter_map_location/actions?query=workflow%3A%22Flutter%22+event%3Apush+branch%3Amain) [![Pub](https://img.shields.io/pub/v/flutter_map_location.svg)](https://pub.dev/packages/flutter_map_location) 6 | 7 | A [flutter_map](https://pub.dev/packages/flutter_map) plugin to request and display the users location and heading on the map. The core features of the plugin are: 8 | 9 | * Customization: The location button and marker can be completly customized. 10 | * Energy efficiency: The location service is turned off if the app runs in the background. 11 | * Usability: Developers are empowered to ensure a good [user experience](#User-experience). 12 | 13 | ## User experience 14 | 15 | Status 16 | 17 | * [x] The location button can be changed dependening on the location services status. For example also Google Maps shows a different icon if the location service is off. 18 | * [x] The marker icon can be changed depending on the location accuracy. 19 | * [x] It's possible to show the information (e.g. in form of a snackbar) to the user that the user location is outside of the map bounds. 20 | * [x] The location heading is also shown for devices without an gyroscope. We [patched flutter_compass](https://github.com/hemanthrajv/flutter_compass/pull/38) for that. 21 | 22 | ## Installation 23 | 24 | Add flutter_map to your pubspec: 25 | 26 | ```yaml 27 | dependencies: 28 | flutter_map_location: any # or the latest version on Pub 29 | ``` 30 | 31 | ### Android 32 | 33 | Ensure the following permissions are present in `/android/app/src/main/AndroidManifest.xml`: 34 | 35 | ```xml 36 | 37 | 38 | ``` 39 | 40 | See [reference example code](https://github.com/Xennis/flutter_map_location/blob/f864b737cfe6371a297cee3be076b6bc117f572c/example/android/app/src/main/AndroidManifest.xml#L4-L5) 41 | 42 | ### iOS 43 | 44 | Ensure the following permission is present in `/ios/Runner/Info.plist`: 45 | 46 | ```xml 47 | NSLocationWhenInUseUsageDescription 48 | App needs access to location and direction when open. 49 | ``` 50 | 51 | See [reference example code](https://github.com/Xennis/flutter_map_location/blob/f864b737cfe6371a297cee3be076b6bc117f572c/example/ios/Runner/Info.plist#L5-L6) 52 | 53 | ## Usage 54 | 55 | Look at the [default example](https://github.com/Xennis/flutter_map_location/blob/main/example/lib/pages/default.dart) and the notes inside the code. That's a working example. 56 | 57 | ## Demo / example 58 | 59 | A working example can be found in the `example/` directory. It contains a page with the default settings: 60 | 61 | ![Default example](https://raw.githubusercontent.com/Xennis/flutter_map_location/main/example/default.png) 62 | 63 | ... and one with customized button and marker: 64 | 65 | ![Custom example](https://raw.githubusercontent.com/Xennis/flutter_map_location/main/example/custom.png) 66 | 67 | (Map attribution: © [OpenStreetMap](https://www.openstreetmap.org/copyright) contributors) 68 | 69 | ## Credits 70 | 71 | The plugin is inspired by [user_location_plugin](https://github.com/igaurab/user_location_plugin) by [igaurab](https://github.com/igaurab). -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | analyzer: 2 | strong-mode: 3 | implicit-casts: false 4 | implicit-dynamic: false 5 | errors: 6 | # treat missing required parameters as a warning (not a hint) 7 | missing_required_param: warning 8 | # treat missing returns as a warning (not a hint) 9 | missing_return: warning 10 | 11 | 12 | linter: 13 | # rules from https://github.com/flutter/flutter/blob/beta/analysis_options.yaml 14 | rules: 15 | # these rules are documented on and in the same order as 16 | # the Dart Lint rules page to make maintenance easier 17 | # https://github.com/dart-lang/linter/blob/master/example/all.yaml 18 | - always_declare_return_types 19 | - always_put_control_body_on_new_line 20 | # - always_put_required_named_parameters_first 21 | - always_require_non_null_named_parameters 22 | - always_specify_types 23 | - annotate_overrides 24 | # - avoid_annotating_with_dynamic # conflicts with always_specify_types 25 | # - avoid_as # required for implicit-casts: true 26 | - avoid_bool_literals_in_conditional_expressions 27 | # - avoid_catches_without_on_clauses 28 | # - avoid_catching_errors 29 | - avoid_classes_with_only_static_members 30 | # - avoid_double_and_int_checks # only useful when targeting JS runtime 31 | - avoid_empty_else 32 | - avoid_equals_and_hash_code_on_mutable_classes 33 | - avoid_field_initializers_in_const_classes 34 | - avoid_function_literals_in_foreach_calls 35 | # - avoid_implementing_value_types 36 | - avoid_init_to_null 37 | # - avoid_js_rounded_ints # only useful when targeting JS runtime 38 | - avoid_null_checks_in_equality_operators 39 | # - avoid_positional_boolean_parameters 40 | # - avoid_print 41 | # - avoid_private_typedef_functions 42 | # - avoid_redundant_argument_values 43 | - avoid_relative_lib_imports 44 | - avoid_renaming_method_parameters 45 | - avoid_return_types_on_setters 46 | # - avoid_returning_null # there are plenty of valid reasons to return null 47 | # - avoid_returning_null_for_future 48 | - avoid_returning_null_for_void 49 | # - avoid_returning_this # there are plenty of valid reasons to return this 50 | # - avoid_setters_without_getters 51 | # - avoid_shadowing_type_parameters 52 | - avoid_single_cascade_in_expression_statements 53 | - avoid_slow_async_io 54 | - avoid_types_as_parameter_names 55 | # - avoid_types_on_closure_parameters # conflicts with always_specify_types 56 | # - avoid_unnecessary_containers 57 | - avoid_unused_constructor_parameters 58 | - avoid_void_async 59 | # - avoid_web_libraries_in_flutter 60 | - await_only_futures 61 | - camel_case_extensions 62 | - camel_case_types 63 | - cancel_subscriptions 64 | # - cascade_invocations 65 | # - close_sinks # not reliable enough 66 | # - comment_references 67 | # - constant_identifier_names 68 | - control_flow_in_finally 69 | # - curly_braces_in_flow_control_structures 70 | # - diagnostic_describe_all_properties 71 | - directives_ordering 72 | - empty_catches 73 | - empty_constructor_bodies 74 | - empty_statements 75 | # - file_names 76 | # - flutter_style_todos 77 | - hash_and_equals 78 | - implementation_imports 79 | # - invariant_booleans # too many false positives 80 | - iterable_contains_unrelated_type 81 | # - join_return_with_assignment 82 | - library_names 83 | - library_prefixes 84 | # - lines_longer_than_80_chars 85 | - list_remove_unrelated_type 86 | # - literal_only_boolean_expressions # too many false positives 87 | # - missing_whitespace_between_adjacent_strings 88 | - no_adjacent_strings_in_list 89 | - no_duplicate_case_values 90 | # - no_logic_in_create_state 91 | # - no_runtimeType_toString 92 | - non_constant_identifier_names 93 | # - null_closures 94 | # - omit_local_variable_types # opposite of always_specify_types 95 | # - one_member_abstracts # too many false positives 96 | # - only_throw_errors 97 | - overridden_fields 98 | - package_api_docs 99 | - package_names 100 | - package_prefixed_library_names 101 | # - parameter_assignments 102 | - prefer_adjacent_string_concatenation 103 | - prefer_asserts_in_initializer_lists 104 | # - prefer_asserts_with_message 105 | - prefer_collection_literals 106 | - prefer_conditional_assignment 107 | - prefer_const_constructors 108 | - prefer_const_constructors_in_immutables 109 | - prefer_const_declarations 110 | - prefer_const_literals_to_create_immutables 111 | # - prefer_constructors_over_static_methods 112 | - prefer_contains 113 | # - prefer_double_quotes # opposite of prefer_single_quotes 114 | - prefer_equal_for_default_values 115 | # - prefer_expression_function_bodies # conflicts with https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#consider-using--for-short-functions-and-methods 116 | - prefer_final_fields 117 | - prefer_final_in_for_each 118 | - prefer_final_locals 119 | - prefer_for_elements_to_map_fromIterable 120 | - prefer_foreach 121 | # - prefer_function_declarations_over_variables 122 | - prefer_generic_function_type_aliases 123 | - prefer_if_elements_to_conditional_expressions 124 | - prefer_if_null_operators 125 | - prefer_initializing_formals 126 | - prefer_inlined_adds 127 | # - prefer_int_literals 128 | # - prefer_interpolation_to_compose_strings 129 | - prefer_is_empty 130 | - prefer_is_not_empty 131 | - prefer_is_not_operator 132 | - prefer_iterable_whereType 133 | # - prefer_mixin 134 | # - prefer_null_aware_operators # disable until NNBD 135 | # - prefer_relative_imports 136 | - prefer_single_quotes 137 | - prefer_spread_collections 138 | - prefer_typing_uninitialized_variables 139 | # - prefer_void_to_null # flutter_map uses it 140 | # - provide_deprecation_message 141 | # - public_member_api_docs 142 | - recursive_getters 143 | - slash_for_doc_comments 144 | # - sort_child_properties_last 145 | - sort_constructors_first 146 | - sort_pub_dependencies 147 | - sort_unnamed_constructors_first 148 | - test_types_in_equals 149 | - throw_in_finally 150 | # - type_annotate_public_apis # subset of always_specify_types 151 | - type_init_formals 152 | # - unawaited_futures # too many false positives 153 | # - unnecessary_await_in_return 154 | - unnecessary_brace_in_string_interps 155 | - unnecessary_const 156 | # - unnecessary_final # conflicts with prefer_final_locals 157 | - unnecessary_getters_setters 158 | # - unnecessary_lambdas # has false positives 159 | - unnecessary_new 160 | - unnecessary_null_aware_assignments 161 | - unnecessary_null_in_if_null_operators 162 | - unnecessary_overrides 163 | - unnecessary_parenthesis 164 | - unnecessary_statements 165 | - unnecessary_string_interpolations 166 | - unnecessary_this 167 | - unrelated_type_equality_checks 168 | # - unsafe_html 169 | - use_full_hex_values_for_flutter_colors 170 | # - use_function_type_syntax_for_parameters 171 | # - use_key_in_widget_constructors 172 | - use_rethrow_when_possible 173 | # - use_setters_to_change_properties 174 | # - use_string_buffers # has false positives 175 | # - use_to_and_as_if_applicable # has false positives 176 | - valid_regexps 177 | - void_checks 178 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_map_location_example 2 | 3 | Demonstrates how to use the flutter_map_location plugin. 4 | 5 | ## Getting Started 6 | 7 | For help getting started with Flutter, view the online 8 | [documentation](http://flutter.io/). 9 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 30 30 | 31 | sourceSets { 32 | main.java.srcDirs += 'src/main/kotlin' 33 | } 34 | 35 | lintOptions { 36 | disable 'InvalidPackage' 37 | } 38 | 39 | defaultConfig { 40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 41 | applicationId "com.example.flutter_map_location_example" 42 | minSdkVersion 16 43 | targetSdkVersion 30 44 | versionCode flutterVersionCode.toInteger() 45 | versionName flutterVersionName 46 | } 47 | 48 | buildTypes { 49 | release { 50 | // TODO: Add your own signing config for the release build. 51 | // Signing with the debug keys for now, so `flutter run --release` works. 52 | signingConfig signingConfigs.debug 53 | } 54 | } 55 | } 56 | 57 | flutter { 58 | source '../..' 59 | } 60 | 61 | dependencies { 62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" 63 | } 64 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 12 | 16 | 23 | 27 | 31 | 36 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/flutter_map_location_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_map_location_example 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() { 6 | } 7 | -------------------------------------------------------------------------------- /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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /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 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.3.72' 3 | repositories { 4 | google() 5 | jcenter() 6 | } 7 | 8 | dependencies { 9 | // version can be found here https://developer.android.com/studio/releases/gradle-plugin 10 | classpath 'com.android.tools.build:gradle:4.1.1' 11 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | jcenter() 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | android.useAndroidX=true 4 | android.enableJetifier=true 5 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 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/android/settings_aar.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /example/custom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/example/custom.png -------------------------------------------------------------------------------- /example/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/example/default.png -------------------------------------------------------------------------------- /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 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 16 | /* End PBXBuildFile section */ 17 | 18 | /* Begin PBXCopyFilesBuildPhase section */ 19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 20 | isa = PBXCopyFilesBuildPhase; 21 | buildActionMask = 2147483647; 22 | dstPath = ""; 23 | dstSubfolderSpec = 10; 24 | files = ( 25 | ); 26 | name = "Embed Frameworks"; 27 | runOnlyForDeploymentPostprocessing = 0; 28 | }; 29 | /* End PBXCopyFilesBuildPhase section */ 30 | 31 | /* Begin PBXFileReference section */ 32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | /* End PBXFileReference section */ 46 | 47 | /* Begin PBXFrameworksBuildPhase section */ 48 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 49 | isa = PBXFrameworksBuildPhase; 50 | buildActionMask = 2147483647; 51 | files = ( 52 | ); 53 | runOnlyForDeploymentPostprocessing = 0; 54 | }; 55 | /* End PBXFrameworksBuildPhase section */ 56 | 57 | /* Begin PBXGroup section */ 58 | 9740EEB11CF90186004384FC /* Flutter */ = { 59 | isa = PBXGroup; 60 | children = ( 61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 65 | ); 66 | name = Flutter; 67 | sourceTree = ""; 68 | }; 69 | 97C146E51CF9000F007C117D = { 70 | isa = PBXGroup; 71 | children = ( 72 | 9740EEB11CF90186004384FC /* Flutter */, 73 | 97C146F01CF9000F007C117D /* Runner */, 74 | 97C146EF1CF9000F007C117D /* Products */, 75 | ); 76 | sourceTree = ""; 77 | }; 78 | 97C146EF1CF9000F007C117D /* Products */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 97C146EE1CF9000F007C117D /* Runner.app */, 82 | ); 83 | name = Products; 84 | sourceTree = ""; 85 | }; 86 | 97C146F01CF9000F007C117D /* Runner */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 92 | 97C147021CF9000F007C117D /* Info.plist */, 93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 97 | ); 98 | path = Runner; 99 | sourceTree = ""; 100 | }; 101 | /* End PBXGroup section */ 102 | 103 | /* Begin PBXNativeTarget section */ 104 | 97C146ED1CF9000F007C117D /* Runner */ = { 105 | isa = PBXNativeTarget; 106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 107 | buildPhases = ( 108 | 9740EEB61CF901F6004384FC /* Run Script */, 109 | 97C146EA1CF9000F007C117D /* Sources */, 110 | 97C146EB1CF9000F007C117D /* Frameworks */, 111 | 97C146EC1CF9000F007C117D /* Resources */, 112 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 114 | ); 115 | buildRules = ( 116 | ); 117 | dependencies = ( 118 | ); 119 | name = Runner; 120 | productName = Runner; 121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 122 | productType = "com.apple.product-type.application"; 123 | }; 124 | /* End PBXNativeTarget section */ 125 | 126 | /* Begin PBXProject section */ 127 | 97C146E61CF9000F007C117D /* Project object */ = { 128 | isa = PBXProject; 129 | attributes = { 130 | LastUpgradeCheck = 1020; 131 | ORGANIZATIONNAME = ""; 132 | TargetAttributes = { 133 | 97C146ED1CF9000F007C117D = { 134 | CreatedOnToolsVersion = 7.3.1; 135 | LastSwiftMigration = 1100; 136 | }; 137 | }; 138 | }; 139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 140 | compatibilityVersion = "Xcode 9.3"; 141 | developmentRegion = en; 142 | hasScannedForEncodings = 0; 143 | knownRegions = ( 144 | en, 145 | Base, 146 | ); 147 | mainGroup = 97C146E51CF9000F007C117D; 148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 149 | projectDirPath = ""; 150 | projectRoot = ""; 151 | targets = ( 152 | 97C146ED1CF9000F007C117D /* Runner */, 153 | ); 154 | }; 155 | /* End PBXProject section */ 156 | 157 | /* Begin PBXResourcesBuildPhase section */ 158 | 97C146EC1CF9000F007C117D /* Resources */ = { 159 | isa = PBXResourcesBuildPhase; 160 | buildActionMask = 2147483647; 161 | files = ( 162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 166 | ); 167 | runOnlyForDeploymentPostprocessing = 0; 168 | }; 169 | /* End PBXResourcesBuildPhase section */ 170 | 171 | /* Begin PBXShellScriptBuildPhase section */ 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 173 | isa = PBXShellScriptBuildPhase; 174 | buildActionMask = 2147483647; 175 | files = ( 176 | ); 177 | inputPaths = ( 178 | ); 179 | name = "Thin Binary"; 180 | outputPaths = ( 181 | ); 182 | runOnlyForDeploymentPostprocessing = 0; 183 | shellPath = /bin/sh; 184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 185 | }; 186 | 9740EEB61CF901F6004384FC /* Run Script */ = { 187 | isa = PBXShellScriptBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | ); 191 | inputPaths = ( 192 | ); 193 | name = "Run Script"; 194 | outputPaths = ( 195 | ); 196 | runOnlyForDeploymentPostprocessing = 0; 197 | shellPath = /bin/sh; 198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 199 | }; 200 | /* End PBXShellScriptBuildPhase section */ 201 | 202 | /* Begin PBXSourcesBuildPhase section */ 203 | 97C146EA1CF9000F007C117D /* Sources */ = { 204 | isa = PBXSourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 209 | ); 210 | runOnlyForDeploymentPostprocessing = 0; 211 | }; 212 | /* End PBXSourcesBuildPhase section */ 213 | 214 | /* Begin PBXVariantGroup section */ 215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 216 | isa = PBXVariantGroup; 217 | children = ( 218 | 97C146FB1CF9000F007C117D /* Base */, 219 | ); 220 | name = Main.storyboard; 221 | sourceTree = ""; 222 | }; 223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 224 | isa = PBXVariantGroup; 225 | children = ( 226 | 97C147001CF9000F007C117D /* Base */, 227 | ); 228 | name = LaunchScreen.storyboard; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXVariantGroup section */ 232 | 233 | /* Begin XCBuildConfiguration section */ 234 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 235 | isa = XCBuildConfiguration; 236 | buildSettings = { 237 | ALWAYS_SEARCH_USER_PATHS = NO; 238 | CLANG_ANALYZER_NONNULL = YES; 239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 240 | CLANG_CXX_LIBRARY = "libc++"; 241 | CLANG_ENABLE_MODULES = YES; 242 | CLANG_ENABLE_OBJC_ARC = YES; 243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 244 | CLANG_WARN_BOOL_CONVERSION = YES; 245 | CLANG_WARN_COMMA = YES; 246 | CLANG_WARN_CONSTANT_CONVERSION = YES; 247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INFINITE_RECURSION = YES; 252 | CLANG_WARN_INT_CONVERSION = YES; 253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 258 | CLANG_WARN_STRICT_PROTOTYPES = YES; 259 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 260 | CLANG_WARN_UNREACHABLE_CODE = YES; 261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 263 | COPY_PHASE_STRIP = NO; 264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 265 | ENABLE_NS_ASSERTIONS = NO; 266 | ENABLE_STRICT_OBJC_MSGSEND = YES; 267 | GCC_C_LANGUAGE_STANDARD = gnu99; 268 | GCC_NO_COMMON_BLOCKS = YES; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 276 | MTL_ENABLE_DEBUG_INFO = NO; 277 | SDKROOT = iphoneos; 278 | SUPPORTED_PLATFORMS = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VALIDATE_PRODUCT = YES; 281 | }; 282 | name = Profile; 283 | }; 284 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 285 | isa = XCBuildConfiguration; 286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 287 | buildSettings = { 288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 289 | CLANG_ENABLE_MODULES = YES; 290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 291 | ENABLE_BITCODE = NO; 292 | FRAMEWORK_SEARCH_PATHS = ( 293 | "$(inherited)", 294 | "$(PROJECT_DIR)/Flutter", 295 | ); 296 | INFOPLIST_FILE = Runner/Info.plist; 297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 298 | LIBRARY_SEARCH_PATHS = ( 299 | "$(inherited)", 300 | "$(PROJECT_DIR)/Flutter", 301 | ); 302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterMapLocationExample; 303 | PRODUCT_NAME = "$(TARGET_NAME)"; 304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 305 | SWIFT_VERSION = 5.0; 306 | VERSIONING_SYSTEM = "apple-generic"; 307 | }; 308 | name = Profile; 309 | }; 310 | 97C147031CF9000F007C117D /* Debug */ = { 311 | isa = XCBuildConfiguration; 312 | buildSettings = { 313 | ALWAYS_SEARCH_USER_PATHS = NO; 314 | CLANG_ANALYZER_NONNULL = YES; 315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 316 | CLANG_CXX_LIBRARY = "libc++"; 317 | CLANG_ENABLE_MODULES = YES; 318 | CLANG_ENABLE_OBJC_ARC = YES; 319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 320 | CLANG_WARN_BOOL_CONVERSION = YES; 321 | CLANG_WARN_COMMA = YES; 322 | CLANG_WARN_CONSTANT_CONVERSION = YES; 323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 325 | CLANG_WARN_EMPTY_BODY = YES; 326 | CLANG_WARN_ENUM_CONVERSION = YES; 327 | CLANG_WARN_INFINITE_RECURSION = YES; 328 | CLANG_WARN_INT_CONVERSION = YES; 329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 334 | CLANG_WARN_STRICT_PROTOTYPES = YES; 335 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 336 | CLANG_WARN_UNREACHABLE_CODE = YES; 337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 339 | COPY_PHASE_STRIP = NO; 340 | DEBUG_INFORMATION_FORMAT = dwarf; 341 | ENABLE_STRICT_OBJC_MSGSEND = YES; 342 | ENABLE_TESTABILITY = YES; 343 | GCC_C_LANGUAGE_STANDARD = gnu99; 344 | GCC_DYNAMIC_NO_PIC = NO; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_OPTIMIZATION_LEVEL = 0; 347 | GCC_PREPROCESSOR_DEFINITIONS = ( 348 | "DEBUG=1", 349 | "$(inherited)", 350 | ); 351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 353 | GCC_WARN_UNDECLARED_SELECTOR = YES; 354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 355 | GCC_WARN_UNUSED_FUNCTION = YES; 356 | GCC_WARN_UNUSED_VARIABLE = YES; 357 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 358 | MTL_ENABLE_DEBUG_INFO = YES; 359 | ONLY_ACTIVE_ARCH = YES; 360 | SDKROOT = iphoneos; 361 | TARGETED_DEVICE_FAMILY = "1,2"; 362 | }; 363 | name = Debug; 364 | }; 365 | 97C147041CF9000F007C117D /* Release */ = { 366 | isa = XCBuildConfiguration; 367 | buildSettings = { 368 | ALWAYS_SEARCH_USER_PATHS = NO; 369 | CLANG_ANALYZER_NONNULL = YES; 370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 371 | CLANG_CXX_LIBRARY = "libc++"; 372 | CLANG_ENABLE_MODULES = YES; 373 | CLANG_ENABLE_OBJC_ARC = YES; 374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 375 | CLANG_WARN_BOOL_CONVERSION = YES; 376 | CLANG_WARN_COMMA = YES; 377 | CLANG_WARN_CONSTANT_CONVERSION = YES; 378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 380 | CLANG_WARN_EMPTY_BODY = YES; 381 | CLANG_WARN_ENUM_CONVERSION = YES; 382 | CLANG_WARN_INFINITE_RECURSION = YES; 383 | CLANG_WARN_INT_CONVERSION = YES; 384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 389 | CLANG_WARN_STRICT_PROTOTYPES = YES; 390 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 391 | CLANG_WARN_UNREACHABLE_CODE = YES; 392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 394 | COPY_PHASE_STRIP = NO; 395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 396 | ENABLE_NS_ASSERTIONS = NO; 397 | ENABLE_STRICT_OBJC_MSGSEND = YES; 398 | GCC_C_LANGUAGE_STANDARD = gnu99; 399 | GCC_NO_COMMON_BLOCKS = YES; 400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 402 | GCC_WARN_UNDECLARED_SELECTOR = YES; 403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 404 | GCC_WARN_UNUSED_FUNCTION = YES; 405 | GCC_WARN_UNUSED_VARIABLE = YES; 406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 407 | MTL_ENABLE_DEBUG_INFO = NO; 408 | SDKROOT = iphoneos; 409 | SUPPORTED_PLATFORMS = iphoneos; 410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | VALIDATE_PRODUCT = YES; 413 | }; 414 | name = Release; 415 | }; 416 | 97C147061CF9000F007C117D /* Debug */ = { 417 | isa = XCBuildConfiguration; 418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 419 | buildSettings = { 420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 421 | CLANG_ENABLE_MODULES = YES; 422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 423 | ENABLE_BITCODE = NO; 424 | FRAMEWORK_SEARCH_PATHS = ( 425 | "$(inherited)", 426 | "$(PROJECT_DIR)/Flutter", 427 | ); 428 | INFOPLIST_FILE = Runner/Info.plist; 429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 430 | LIBRARY_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "$(PROJECT_DIR)/Flutter", 433 | ); 434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterMapLocationExample; 435 | PRODUCT_NAME = "$(TARGET_NAME)"; 436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 438 | SWIFT_VERSION = 5.0; 439 | VERSIONING_SYSTEM = "apple-generic"; 440 | }; 441 | name = Debug; 442 | }; 443 | 97C147071CF9000F007C117D /* Release */ = { 444 | isa = XCBuildConfiguration; 445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | CLANG_ENABLE_MODULES = YES; 449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 450 | ENABLE_BITCODE = NO; 451 | FRAMEWORK_SEARCH_PATHS = ( 452 | "$(inherited)", 453 | "$(PROJECT_DIR)/Flutter", 454 | ); 455 | INFOPLIST_FILE = Runner/Info.plist; 456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 457 | LIBRARY_SEARCH_PATHS = ( 458 | "$(inherited)", 459 | "$(PROJECT_DIR)/Flutter", 460 | ); 461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterMapLocationExample; 462 | PRODUCT_NAME = "$(TARGET_NAME)"; 463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 464 | SWIFT_VERSION = 5.0; 465 | VERSIONING_SYSTEM = "apple-generic"; 466 | }; 467 | name = Release; 468 | }; 469 | /* End XCBuildConfiguration section */ 470 | 471 | /* Begin XCConfigurationList section */ 472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 473 | isa = XCConfigurationList; 474 | buildConfigurations = ( 475 | 97C147031CF9000F007C117D /* Debug */, 476 | 97C147041CF9000F007C117D /* Release */, 477 | 249021D3217E4FDB00AE95B9 /* Profile */, 478 | ); 479 | defaultConfigurationIsVisible = 0; 480 | defaultConfigurationName = Release; 481 | }; 482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 483 | isa = XCConfigurationList; 484 | buildConfigurations = ( 485 | 97C147061CF9000F007C117D /* Debug */, 486 | 97C147071CF9000F007C117D /* Release */, 487 | 249021D4217E4FDB00AE95B9 /* Profile */, 488 | ); 489 | defaultConfigurationIsVisible = 0; 490 | defaultConfigurationName = Release; 491 | }; 492 | /* End XCConfigurationList section */ 493 | }; 494 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 495 | } 496 | -------------------------------------------------------------------------------- /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 | 8 | -------------------------------------------------------------------------------- /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 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Xennis/flutter_map_location/367d33ac22adc40d4f89fd6ce1c80cf09fe7dc96/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 | NSLocationWhenInUseUsageDescription 6 | App needs access to location and direction when open. 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | flutter_map_location_example 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | $(FLUTTER_BUILD_NUMBER) 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | UIViewControllerBasedStatusBarAppearance 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'pages/controller.dart'; 4 | import 'pages/custom.dart'; 5 | import 'pages/default.dart'; 6 | 7 | void main() => runApp(MyApp()); 8 | 9 | class MyApp extends StatelessWidget { 10 | @override 11 | Widget build(BuildContext context) { 12 | return MaterialApp( 13 | title: 'Location Examples', 14 | theme: ThemeData( 15 | primarySwatch: Colors.blue, 16 | visualDensity: VisualDensity.adaptivePlatformDensity, 17 | ), 18 | home: DefaultPage(), 19 | routes: { 20 | CustomPage.route: (_) => CustomPage(), 21 | ControllerPage.route: (_) => ControllerPage(), 22 | }); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /example/lib/pages/controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:developer'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_map/flutter_map.dart'; 5 | import 'package:flutter_map_location/flutter_map_location.dart'; 6 | 7 | import '../widgets/drawer.dart'; 8 | 9 | class ControllerPage extends StatefulWidget { 10 | static const String route = 'controller'; 11 | 12 | @override 13 | _ControllerPageState createState() => _ControllerPageState(); 14 | } 15 | 16 | class _ControllerPageState extends State { 17 | final MapController _mapController = MapController(); 18 | final LocationController _locationController = LocationController(); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return Scaffold( 23 | appBar: AppBar( 24 | title: const Text('Controller'), 25 | ), 26 | drawer: buildDrawer(context, ControllerPage.route), 27 | body: Center( 28 | child: Column(children: [ 29 | Padding( 30 | padding: const EdgeInsets.all(8.0), 31 | child: Row( 32 | children: [ 33 | ElevatedButton( 34 | onPressed: () { 35 | print('Unsubscribe'); 36 | _locationController.unsubscribe(); 37 | }, 38 | child: const Text('Unsubscribe'), 39 | ) 40 | ], 41 | ), 42 | ), 43 | Flexible( 44 | child: FlutterMap( 45 | mapController: _mapController, 46 | options: MapOptions( 47 | plugins: [ 48 | LocationPlugin(), 49 | ], 50 | ), 51 | layers: [ 52 | TileLayerOptions( 53 | urlTemplate: 54 | 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 55 | subdomains: ['a', 'b', 'c'], 56 | ), 57 | ], 58 | nonRotatedLayers: [ 59 | LocationOptions( 60 | locationButton(), 61 | controller: _locationController, 62 | onLocationUpdate: (LatLngData? ld) { 63 | print( 64 | 'Location updated: ${ld?.location} (accuracy: ${ld?.accuracy})'); 65 | }, 66 | onLocationRequested: (LatLngData? ld) { 67 | if (ld == null) { 68 | return; 69 | } 70 | _mapController.move(ld.location, 16.0); 71 | }, 72 | ), 73 | ], 74 | ), 75 | ) 76 | ]))); 77 | } 78 | 79 | LocationButtonBuilder locationButton() { 80 | return (BuildContext context, ValueNotifier status, 81 | Function onPressed) { 82 | return Align( 83 | alignment: Alignment.bottomRight, 84 | child: Padding( 85 | padding: const EdgeInsets.only(bottom: 16.0, right: 16.0), 86 | child: FloatingActionButton( 87 | child: const Icon( 88 | Icons.location_searching, 89 | color: Colors.white, 90 | ), 91 | onPressed: () { 92 | log('Subscribe'); 93 | onPressed(); 94 | }), 95 | ), 96 | ); 97 | }; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /example/lib/pages/custom.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map_location/flutter_map_location.dart'; 4 | 5 | import '../widgets/drawer.dart'; 6 | 7 | class CustomPage extends StatefulWidget { 8 | static const String route = 'custom'; 9 | 10 | @override 11 | _CustomPageState createState() => _CustomPageState(); 12 | } 13 | 14 | class _CustomPageState extends State { 15 | final MapController _mapController = MapController(); 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | return Scaffold( 20 | appBar: AppBar( 21 | title: const Text('Customized'), 22 | ), 23 | drawer: buildDrawer(context, CustomPage.route), 24 | body: Center( 25 | child: FlutterMap( 26 | mapController: _mapController, 27 | options: MapOptions( 28 | plugins: [ 29 | LocationPlugin(), 30 | ], 31 | ), 32 | layers: [ 33 | TileLayerOptions( 34 | urlTemplate: 35 | 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 36 | subdomains: ['a', 'b', 'c'], 37 | ), 38 | ], 39 | nonRotatedLayers: [ 40 | LocationOptions( 41 | locationButton(), 42 | initiallyRequest: false, 43 | onLocationUpdate: (LatLngData? ld) { 44 | print( 45 | 'Location updated: ${ld?.location} (accuracy: ${ld?.accuracy})'); 46 | }, 47 | onLocationRequested: (LatLngData? ld) { 48 | if (ld == null) { 49 | return; 50 | } 51 | _mapController.move(ld.location, 16.0); 52 | }, 53 | markerBuilder: (BuildContext context, LatLngData ld, 54 | ValueNotifier heading) { 55 | return Marker( 56 | point: ld.location, 57 | builder: (_) => Container( 58 | child: Column( 59 | children: [ 60 | Stack( 61 | alignment: AlignmentDirectional.center, 62 | children: [ 63 | Container( 64 | decoration: BoxDecoration( 65 | shape: BoxShape.circle, 66 | color: Colors.pink[300]!.withOpacity(0.7)), 67 | height: 40.0, 68 | width: 40.0, 69 | ), 70 | const Icon( 71 | Icons.location_city, 72 | size: 30.0, 73 | ), 74 | ], 75 | ), 76 | ], 77 | ), 78 | ), 79 | height: 60.0, 80 | width: 60.0, 81 | ); 82 | }, 83 | ), 84 | ], 85 | ), 86 | )); 87 | } 88 | 89 | LocationButtonBuilder locationButton() { 90 | return (BuildContext context, ValueNotifier status, 91 | Function onPressed) { 92 | return Align( 93 | alignment: Alignment.bottomCenter, 94 | child: Padding( 95 | padding: const EdgeInsets.only(bottom: 16.0), 96 | child: FloatingActionButton( 97 | backgroundColor: Colors.pink, 98 | child: const Icon( 99 | Icons.home, 100 | color: Colors.black, 101 | ), 102 | onPressed: () => onPressed()), 103 | ), 104 | ); 105 | }; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /example/lib/pages/default.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map_location/flutter_map_location.dart'; 4 | 5 | import '../widgets/drawer.dart'; 6 | 7 | class DefaultPage extends StatefulWidget { 8 | static const String route = '/'; 9 | 10 | @override 11 | _DefaultPageState createState() => _DefaultPageState(); 12 | } 13 | 14 | class _DefaultPageState extends State { 15 | // USAGE NOTE 1: Add a controler and marker list: 16 | final MapController mapController = MapController(); 17 | 18 | @override 19 | Widget build(BuildContext context) { 20 | return Scaffold( 21 | appBar: AppBar( 22 | title: const Text('Default'), 23 | ), 24 | drawer: buildDrawer(context, DefaultPage.route), 25 | body: Center( 26 | child: FlutterMap( 27 | mapController: mapController, 28 | options: MapOptions( 29 | plugins: [ 30 | // USAGE NOTE 2: Add the plugin 31 | LocationPlugin(), 32 | ], 33 | ), 34 | layers: [ 35 | TileLayerOptions( 36 | urlTemplate: 37 | 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', 38 | subdomains: ['a', 'b', 'c'], 39 | ), 40 | ], 41 | nonRotatedLayers: [ 42 | // USAGE NOTE 3: Add the options for the plugin 43 | LocationOptions( 44 | locationButton(), 45 | onLocationUpdate: (LatLngData? ld) { 46 | print( 47 | 'Location updated: ${ld?.location} (accuracy: ${ld?.accuracy})'); 48 | }, 49 | onLocationRequested: (LatLngData? ld) { 50 | if (ld == null) { 51 | return; 52 | } 53 | mapController.move(ld.location, 16.0); 54 | }, 55 | ), 56 | ], 57 | ), 58 | )); 59 | } 60 | 61 | LocationButtonBuilder locationButton() { 62 | return (BuildContext context, ValueNotifier status, 63 | Function onPressed) { 64 | return Align( 65 | alignment: Alignment.bottomRight, 66 | child: Padding( 67 | padding: const EdgeInsets.only(bottom: 16.0, right: 16.0), 68 | child: FloatingActionButton( 69 | child: ValueListenableBuilder( 70 | valueListenable: status, 71 | builder: (BuildContext context, LocationServiceStatus value, 72 | Widget? child) { 73 | switch (value) { 74 | case LocationServiceStatus.disabled: 75 | case LocationServiceStatus.permissionDenied: 76 | case LocationServiceStatus.unsubscribed: 77 | return const Icon( 78 | Icons.location_disabled, 79 | color: Colors.white, 80 | ); 81 | default: 82 | return const Icon( 83 | Icons.location_searching, 84 | color: Colors.white, 85 | ); 86 | } 87 | }), 88 | onPressed: () => onPressed()), 89 | ), 90 | ); 91 | }; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /example/lib/widgets/drawer.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import '../pages/controller.dart'; 4 | import '../pages/custom.dart'; 5 | import '../pages/default.dart'; 6 | 7 | Widget _buildMenuItem( 8 | BuildContext context, Widget title, String routeName, String currentRoute) { 9 | final bool isSelected = routeName == currentRoute; 10 | return ListTile( 11 | title: title, 12 | selected: isSelected, 13 | onTap: () { 14 | if (isSelected) { 15 | Navigator.pop(context); 16 | } else { 17 | Navigator.pushReplacementNamed(context, routeName); 18 | } 19 | }, 20 | ); 21 | } 22 | 23 | Drawer buildDrawer(BuildContext context, String currentRoute) { 24 | return Drawer( 25 | child: ListView( 26 | children: [ 27 | const DrawerHeader( 28 | child: Center( 29 | child: Text('Location Examples'), 30 | ), 31 | ), 32 | _buildMenuItem( 33 | context, 34 | const Text('Default'), 35 | DefaultPage.route, 36 | currentRoute, 37 | ), 38 | _buildMenuItem( 39 | context, 40 | const Text('Custom'), 41 | CustomPage.route, 42 | currentRoute, 43 | ), 44 | _buildMenuItem( 45 | context, 46 | const Text('Controller'), 47 | ControllerPage.route, 48 | currentRoute, 49 | ), 50 | ], 51 | ), 52 | ); 53 | } 54 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_map_location_example 2 | description: Demonstrates how to use the flutter_map_location plugin. 3 | 4 | environment: 5 | sdk: ">=2.12.0 <3.0.0" 6 | 7 | dependencies: 8 | flutter: 9 | sdk: flutter 10 | flutter_map_location: 11 | path: ../ 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | flutter: 18 | uses-material-design: true 19 | -------------------------------------------------------------------------------- /example/test/main_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map_location/flutter_map_location.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | // ignore: avoid_relative_lib_imports 7 | import '../lib/main.dart'; 8 | 9 | void main() { 10 | testWidgets('Render app', (WidgetTester tester) async { 11 | await tester.pumpWidget(MyApp()); 12 | await tester.pumpAndSettle(const Duration(seconds: 5)); 13 | expect(find.byType(FlutterMap), findsOneWidget); 14 | expect(find.byType(LocationLayer), findsOneWidget); 15 | expect(find.byType(FloatingActionButton), findsOneWidget); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /example/test/pages/controller_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map_location/flutter_map_location.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | // ignore: avoid_relative_lib_imports 7 | import '../../lib/pages/controller.dart'; 8 | 9 | void main() { 10 | testWidgets('Render ControllerPage', (WidgetTester tester) async { 11 | await tester.pumpWidget(MaterialApp(home: ControllerPage())); 12 | await tester.pumpAndSettle(const Duration(seconds: 5)); 13 | expect(find.byType(FlutterMap), findsOneWidget); 14 | expect(find.byType(LocationLayer), findsOneWidget); 15 | expect(find.byType(FloatingActionButton), findsOneWidget); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /example/test/pages/custom_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map_location/flutter_map_location.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | // ignore: avoid_relative_lib_imports 7 | import '../../lib/pages/custom.dart'; 8 | 9 | void main() { 10 | testWidgets('Render CustomPage', (WidgetTester tester) async { 11 | await tester.pumpWidget(MaterialApp(home: CustomPage())); 12 | await tester.pumpAndSettle(const Duration(seconds: 5)); 13 | expect(find.byType(FlutterMap), findsOneWidget); 14 | expect(find.byType(LocationLayer), findsOneWidget); 15 | expect(find.byType(FloatingActionButton), findsOneWidget); 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /lib/flutter_map_location.dart: -------------------------------------------------------------------------------- 1 | library flutter_map_location; 2 | 3 | import 'package:flutter_map_location/src/location_controller.dart'; 4 | 5 | export 'src/location_layer.dart'; 6 | export 'src/location_marker.dart'; 7 | export 'src/location_options.dart'; 8 | export 'src/location_plugin.dart'; 9 | export 'src/types.dart'; 10 | 11 | /// Controller to programmatically interact with [LocationPlugin]. 12 | abstract class LocationController { 13 | factory LocationController() => LocationControllerImpl(); 14 | 15 | /// Unsubscribe from location subscription. 16 | Future unsubscribe(); 17 | } 18 | -------------------------------------------------------------------------------- /lib/src/location_controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter_compass/flutter_compass.dart'; 4 | import 'package:flutter_map_location/flutter_map_location.dart'; 5 | import 'package:geolocator/geolocator.dart'; 6 | import 'package:latlong2/latlong.dart'; 7 | 8 | class LocationControllerImpl implements LocationController { 9 | final StreamController _controller = 10 | StreamController.broadcast(); 11 | StreamSubscription? _onLocationChangedSub; 12 | StreamSubscription? _compassEventsSub; 13 | 14 | bool _isSubscribed = false; 15 | 16 | void dispose() { 17 | _controller.close(); 18 | _compassEventsSub?.cancel(); 19 | _onLocationChangedSub?.cancel(); 20 | } 21 | 22 | @override 23 | Future unsubscribe() { 24 | final List> waitGroup = >[]; 25 | waitGroup.add(unsubscribeCompass()); 26 | waitGroup.add(unsubscribePosition()); 27 | return Future.wait(waitGroup); 28 | } 29 | 30 | Future unsubscribePosition() { 31 | if (_onLocationChangedSub != null) { 32 | _isSubscribed = false; 33 | return _onLocationChangedSub!.cancel(); 34 | } 35 | return Future.value(); 36 | } 37 | 38 | Future unsubscribeCompass() { 39 | if (_compassEventsSub != null) { 40 | return _compassEventsSub!.cancel(); 41 | } 42 | return Future.value(); 43 | } 44 | 45 | Future requestPermissions() async { 46 | if (await Geolocator.checkPermission() == LocationPermission.denied) { 47 | if ([ 48 | LocationPermission.always, 49 | LocationPermission.whileInUse 50 | ].contains(await Geolocator.requestPermission()) == 51 | false) { 52 | return Future.value(false); 53 | } 54 | } 55 | return Future.value(true); 56 | } 57 | 58 | Stream subscribePosition( 59 | Duration intervalDuration, LocationAccuracy locationAccuracy) { 60 | _isSubscribed = true; 61 | _onLocationChangedSub = Geolocator.getPositionStream( 62 | intervalDuration: intervalDuration, 63 | desiredAccuracy: locationAccuracy) 64 | .listen((Position ld) { 65 | _controller 66 | .add(LatLngData(LatLng(ld.latitude, ld.longitude), ld.accuracy)); 67 | }, onError: (Object error) { 68 | _controller.addError(error); 69 | }, onDone: () { 70 | _isSubscribed = false; 71 | _controller.done; 72 | }); 73 | 74 | return _controller.stream.asBroadcastStream(); 75 | } 76 | 77 | void subscribeCompass(void onData(CompassEvent event)?) { 78 | _compassEventsSub = FlutterCompass.events?.listen(onData); 79 | } 80 | 81 | bool isSubscribed() { 82 | return _isSubscribed; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /lib/src/location_layer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter/widgets.dart'; 5 | import 'package:flutter_compass/flutter_compass.dart' show CompassEvent; 6 | import 'package:flutter_map/plugin_api.dart'; 7 | import 'package:flutter_map_location/flutter_map_location.dart'; 8 | import 'package:flutter_map_location/src/location_controller.dart'; 9 | import 'package:flutter_map_location/src/types.dart'; 10 | import 'package:geolocator/geolocator.dart' 11 | show Geolocator, LocationServiceDisabledException; 12 | 13 | import 'location_marker.dart'; 14 | import 'location_options.dart'; 15 | import 'types.dart'; 16 | 17 | LocationMarkerBuilder _defaultMarkerBuilder = 18 | (BuildContext context, LatLngData ld, ValueNotifier heading) { 19 | final double diameter = ld.highAccuracy() ? 60.0 : 120.0; 20 | return Marker( 21 | point: ld.location, 22 | builder: (_) => LocationMarker(ld, heading), 23 | height: diameter, 24 | width: diameter, 25 | rotate: false, 26 | ); 27 | }; 28 | 29 | class LocationLayer extends StatefulWidget { 30 | const LocationLayer(this.options, this.map, this.stream, {Key? key}) 31 | : super(key: key); 32 | 33 | final LocationOptions options; 34 | final MapState map; 35 | final Stream stream; 36 | 37 | @override 38 | _LocationLayerState createState() => _LocationLayerState(); 39 | } 40 | 41 | class _LocationLayerState extends State 42 | with WidgetsBindingObserver { 43 | final ValueNotifier _serviceStatus = 44 | ValueNotifier(LocationServiceStatus.unknown); 45 | final ValueNotifier _location = ValueNotifier(null); 46 | final ValueNotifier _heading = ValueNotifier(null); 47 | late final LocationControllerImpl _controller; 48 | 49 | StreamSubscription? _locationSub; 50 | bool _locationRequested = false; 51 | 52 | @override 53 | void initState() { 54 | super.initState(); 55 | _controller = widget.options.controller as LocationControllerImpl? ?? 56 | LocationController() as LocationControllerImpl; 57 | WidgetsBinding.instance?.addObserver(this); 58 | if (widget.options.initiallyRequest) { 59 | _locationRequested = true; 60 | _initOnLocationUpdateSubscription(); 61 | } 62 | } 63 | 64 | @override 65 | void dispose() { 66 | _locationSub?.cancel(); 67 | _controller.dispose(); 68 | WidgetsBinding.instance?.removeObserver(this); 69 | super.dispose(); 70 | } 71 | 72 | @override 73 | void didChangeAppLifecycleState(AppLifecycleState state) { 74 | super.didChangeAppLifecycleState(state); 75 | switch (state) { 76 | case AppLifecycleState.paused: 77 | _controller.unsubscribeCompass(); 78 | _controller.unsubscribePosition(); 79 | if (_serviceStatus.value == LocationServiceStatus.subscribed) { 80 | _serviceStatus.value = LocationServiceStatus.paused; 81 | } else { 82 | _serviceStatus.value = LocationServiceStatus.unknown; 83 | } 84 | break; 85 | case AppLifecycleState.resumed: 86 | if (_serviceStatus.value == LocationServiceStatus.paused) { 87 | _serviceStatus.value = LocationServiceStatus.unknown; 88 | _initOnLocationUpdateSubscription(); 89 | } 90 | break; 91 | case AppLifecycleState.inactive: 92 | case AppLifecycleState.detached: 93 | break; 94 | } 95 | } 96 | 97 | @override 98 | Widget build(BuildContext context) { 99 | return Container( 100 | child: Stack( 101 | children: [ 102 | ValueListenableBuilder( 103 | valueListenable: _location, 104 | builder: (BuildContext context, LatLngData? ld, Widget? child) { 105 | if (ld == null) { 106 | return Container(); 107 | } 108 | final LocationMarkerBuilder? customBuilder = 109 | widget.options.markerBuilder; 110 | final Marker marker = customBuilder != null 111 | ? customBuilder(context, ld, _heading) 112 | : _defaultMarkerBuilder(context, ld, _heading); 113 | return MarkerLayerWidget( 114 | options: MarkerLayerOptions(markers: [marker])); 115 | }), 116 | widget.options.buttonBuilder(context, _serviceStatus, () async { 117 | // Check if there is no location subscription, no location value or the location service is off. 118 | if (!_controller.isSubscribed() || 119 | !await Geolocator.isLocationServiceEnabled()) { 120 | _initOnLocationUpdateSubscription(); 121 | _locationRequested = true; 122 | return; 123 | } 124 | 125 | widget.options.onLocationRequested?.call(_location.value); 126 | }) 127 | ], 128 | )); 129 | } 130 | 131 | // ignore: avoid_void_async 132 | void _initOnLocationUpdateSubscription() async { 133 | if (!await _controller.requestPermissions()) { 134 | _serviceStatus.value = LocationServiceStatus.permissionDenied; 135 | return; 136 | } 137 | 138 | await _locationSub?.cancel(); 139 | await _controller.unsubscribePosition(); 140 | _locationSub = _controller 141 | .subscribePosition( 142 | widget.options.updateInterval, widget.options.locationAccuracy) 143 | .listen((LatLngData loc) { 144 | _location.value = loc; 145 | widget.options.onLocationUpdate?.call(loc); 146 | if (_locationRequested) { 147 | _locationRequested = false; 148 | widget.options.onLocationRequested?.call(loc); 149 | } 150 | }, onError: (Object error) { 151 | if (error is LocationServiceDisabledException) { 152 | _serviceStatus.value = LocationServiceStatus.disabled; 153 | } else { 154 | _serviceStatus.value = LocationServiceStatus.unsubscribed; 155 | } 156 | }, onDone: () { 157 | _serviceStatus.value = LocationServiceStatus.unsubscribed; 158 | }); 159 | 160 | await _controller.unsubscribeCompass(); 161 | _controller.subscribeCompass((CompassEvent event) { 162 | _heading.value = event.heading; 163 | }); 164 | 165 | _serviceStatus.value = LocationServiceStatus.subscribed; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /lib/src/location_marker.dart: -------------------------------------------------------------------------------- 1 | import 'dart:math'; 2 | 3 | import 'package:flutter/material.dart'; 4 | import 'package:flutter_map_location/src/types.dart'; 5 | 6 | double _degree2Radian(double degree) { 7 | return degree * pi / 180.0; 8 | } 9 | 10 | class LocationMarker extends StatelessWidget { 11 | const LocationMarker(this.ld, this.heading, {Key? key}) : super(key: key); 12 | 13 | static final CustomPainter headingerPainter = LocationMarkerHeading(); 14 | final LatLngData ld; 15 | final ValueNotifier heading; 16 | 17 | @override 18 | Widget build(BuildContext context) { 19 | final double diameter = ld.highAccuracy() ? 22.0 : 80.0; 20 | return Container( 21 | child: Column( 22 | mainAxisAlignment: MainAxisAlignment.center, 23 | children: [ 24 | Stack( 25 | alignment: AlignmentDirectional.center, 26 | children: [ 27 | ValueListenableBuilder( 28 | valueListenable: heading, 29 | builder: 30 | (BuildContext context, double? value, Widget? child) { 31 | if (value == null) { 32 | return Container(); 33 | } 34 | // Only display heading for an accurate location. 35 | if (!ld.highAccuracy()) { 36 | return Container(); 37 | } 38 | return Transform.rotate( 39 | angle: _degree2Radian(value), 40 | child: CustomPaint( 41 | painter: headingerPainter, 42 | ), 43 | ); 44 | }), 45 | Container( 46 | decoration: BoxDecoration( 47 | shape: BoxShape.circle, 48 | color: Colors.blue[300]!.withOpacity(0.7)), 49 | height: diameter, 50 | width: diameter, 51 | ), 52 | Container( 53 | decoration: const BoxDecoration( 54 | shape: BoxShape.circle, color: Colors.blueAccent), 55 | height: 14.0, 56 | width: 14.0, 57 | ), 58 | ], 59 | ), 60 | ], 61 | ), 62 | ); 63 | } 64 | } 65 | 66 | class LocationMarkerHeading extends CustomPainter { 67 | @override 68 | void paint(Canvas canvas, Size size) { 69 | final Rect rect = Rect.fromCircle( 70 | center: Offset.zero, 71 | radius: 50, 72 | ); 73 | final Gradient gradient = RadialGradient( 74 | colors: [ 75 | Colors.blue.shade500.withOpacity(0.7), 76 | Colors.blue.shade500.withOpacity(0.3), 77 | Colors.transparent, 78 | ], 79 | stops: const [ 80 | 0.0, 81 | 0.5, 82 | 1.0, 83 | ], 84 | ); 85 | final Paint paint = Paint(); 86 | paint.shader = gradient.createShader(rect); 87 | canvas.drawArc(rect, _degree2Radian(200), _degree2Radian(140), true, paint); 88 | } 89 | 90 | @override 91 | bool shouldRepaint(CustomPainter oldDelegate) { 92 | return false; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /lib/src/location_options.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map/plugin_api.dart'; 4 | import 'package:flutter_map_location/flutter_map_location.dart'; 5 | import 'package:flutter_map_location/src/location_controller.dart'; 6 | import 'package:flutter_map_location/src/types.dart'; 7 | import 'package:geolocator/geolocator.dart'; 8 | 9 | enum LocationServiceStatus { 10 | unknown, 11 | disabled, 12 | permissionDenied, 13 | subscribed, 14 | paused, 15 | unsubscribed, 16 | } 17 | 18 | typedef LocationButtonBuilder = Widget Function(BuildContext context, 19 | ValueNotifier, Function onPressed); 20 | 21 | typedef LocationMarkerBuilder = Marker Function( 22 | BuildContext context, LatLngData ld, ValueNotifier heading); 23 | 24 | class LocationOptions extends LayerOptions { 25 | LocationOptions(this.buttonBuilder, 26 | {this.onLocationUpdate, 27 | this.onLocationRequested, 28 | this.markerBuilder, 29 | LocationController? controller, 30 | this.updateInterval = const Duration(seconds: 1), 31 | this.initiallyRequest = true, 32 | this.locationAccuracy = LocationAccuracy.best}) 33 | : controller = controller ?? LocationControllerImpl(), 34 | super(); 35 | 36 | /// If the LocationController is provided it can be used to programmatically access 37 | /// the functions of the plugin. 38 | final LocationController controller; 39 | final void Function(LatLngData?)? onLocationUpdate; 40 | final void Function(LatLngData?)? onLocationRequested; 41 | final LocationButtonBuilder buttonBuilder; 42 | final LocationMarkerBuilder? markerBuilder; 43 | final Duration updateInterval; 44 | final LocationAccuracy locationAccuracy; 45 | final bool initiallyRequest; 46 | } 47 | -------------------------------------------------------------------------------- /lib/src/location_plugin.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/widgets.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map/plugin_api.dart'; 4 | 5 | import 'location_layer.dart'; 6 | import 'location_options.dart'; 7 | 8 | class LocationPlugin extends MapPlugin { 9 | @override 10 | Widget createLayer( 11 | LayerOptions options, MapState mapState, Stream stream) { 12 | if (options is LocationOptions) { 13 | return LocationLayer(options, mapState, stream); 14 | } 15 | throw ArgumentError('options is not of type LocationOptions'); 16 | } 17 | 18 | @override 19 | bool supportsLayer(LayerOptions options) { 20 | return options is LocationOptions; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /lib/src/types.dart: -------------------------------------------------------------------------------- 1 | import 'package:latlong2/latlong.dart'; 2 | 3 | class LatLngData { 4 | const LatLngData(this.location, this.accuracy); 5 | 6 | final LatLng location; 7 | 8 | /// Estimated horizontal accuracy, radial, in meters. 9 | /// 10 | /// If the accuracy is not available it's 0.0. 11 | final double accuracy; 12 | 13 | bool highAccuracy() { 14 | // Use > and not >= because 0.0 means no accurency. 15 | return accuracy > 0.0 && accuracy <= 30.0; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_map_location 2 | description: flutter_map plugin to request and display the users location and heading on the map. 3 | version: 0.12.0 4 | homepage: https://github.com/Xennis/flutter_map_location 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | flutter: ">=2.0.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_compass: ^0.7.0 14 | flutter_map: ^0.13.1 15 | geolocator: ^7.0.3 16 | latlong2: ^0.8.0 17 | 18 | dev_dependencies: 19 | flutter_test: 20 | sdk: flutter 21 | -------------------------------------------------------------------------------- /test/app_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'package:flutter_map/flutter_map.dart'; 3 | import 'package:flutter_map_location/flutter_map_location.dart'; 4 | import 'package:flutter_test/flutter_test.dart'; 5 | 6 | void main() { 7 | testWidgets('Render app', (WidgetTester tester) async { 8 | await tester.pumpWidget(_TestApp()); 9 | // See https://github.com/flutter/flutter/issues/11181#issuecomment-568737491 10 | await tester.pumpAndSettle(const Duration(seconds: 5)); 11 | expect(find.byType(FlutterMap), findsOneWidget); 12 | expect(find.byType(LocationLayer), findsOneWidget); 13 | expect(find.byType(FloatingActionButton), findsOneWidget); 14 | }); 15 | } 16 | 17 | class _TestApp extends StatelessWidget { 18 | final MapController mapController = MapController(); 19 | 20 | @override 21 | Widget build(BuildContext context) { 22 | return MaterialApp( 23 | home: Scaffold( 24 | body: Center( 25 | child: FlutterMap( 26 | options: MapOptions( 27 | plugins: [ 28 | LocationPlugin(), 29 | ], 30 | ), 31 | layers: [ 32 | TileLayerOptions( 33 | urlTemplate: 'https://{s}.tile.example.org/{z}/{x}/{y}.png', 34 | subdomains: ['a', 'b', 'c']), 35 | LocationOptions( 36 | (BuildContext context, 37 | ValueNotifier status, 38 | Function onPressed) { 39 | return Align( 40 | alignment: Alignment.bottomRight, 41 | child: Padding( 42 | padding: const EdgeInsets.only(bottom: 16.0, right: 16.0), 43 | child: FloatingActionButton( 44 | child: const Icon( 45 | Icons.location_searching, 46 | ), 47 | onPressed: () {}), 48 | ), 49 | ); 50 | }, 51 | ), 52 | ], 53 | ), 54 | ), 55 | ), 56 | ); 57 | } 58 | } 59 | --------------------------------------------------------------------------------