diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index ad653cd1..8113e786 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,7 +1,7 @@ { "flutterSdkVersion": "stable", "flavors": { - "lts": "3.0.0", + "lts": "3.10.0", "main": "stable", "edge": "beta" } diff --git a/.tmuxinator.yml b/.tmuxinator.yml new file mode 100644 index 00000000..1106c0d2 --- /dev/null +++ b/.tmuxinator.yml @@ -0,0 +1,16 @@ +name: google_maps_place_picker_mb +root: . + +pre_window: tmux set status-bg color31 + +windows: + - package: + root: . + panes: + - vim README.md +'sil! so Session.vim' + - example: + root: example + panes: + - vim README.md +'sil! so Session.vim' + +startup_window: package diff --git a/CHANGELOG.md b/CHANGELOG.md index e46b976c..029b3f0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [3.1.0] - 14/Jul/2023 + +- Graceful location requests via `ignoreLocationPermissionErrors` +- Better zoom controls that look more consistent with the overall experience +- Upgrade packages + ## [3.0.2] - 10/May/2023 - Fix getting current location diff --git a/README.md b/README.md index 05cd6479..390c93ec 100644 --- a/README.md +++ b/README.md @@ -271,10 +271,11 @@ myLocationButtonCooldown | int | Cooldown time in seconds for the 'myLocationBut forceSearchOnZoomChanged | bool | Wether to allow place search even when the zoom has changed. Defaults to false. automaticallyImplyAppBarLeading | bool | By default, there is a back button on the top. Setting false will remove the back button. autocompleteOnTrailingWhitespace | bool | Whether to allow autocomplete to run even on whitespace at the end of the search. Defaults to false. +hidePlaceDetailsWhenDraggingPin | bool | Whether to hide place details when dragging pin. Defaults to true. +ignoreLocationPermissionErrors* | bool | Whether to ignore location permission errors. Defaults to false. onTapBack* | Function(PlaceProvider)? | Called when leaving the Google Picker by pressing the back button. zoomGesturesEnabled\* | bool | Disable pinch zoom gestures, this does not control the appearance of the zoom in/out buttons. zoomControlsEnabled\* | bool | Show the zoom in/out buttons on the bottom right of the screen, this does not control the pinch zoom gestures. -compassEnabled\* | bool | Show the compass to allow the user re-orient the map towards North. onCameraMoveStarted\* | Function(PlaceProvider)? | Called when the camera starts moving. (GoogleMap widget) onCameraMove\* | CameraPositionCallback? | Called repeatedly as the camera continues to move after an onCameraMoveStarted call. (GoogleMap widget) onCameraIdle\* | Function(PlaceProvider)? | Called when camera movement has ended, there are no pending animations and the user has stopped interacting with the map. (GoogleMap widget) diff --git a/example/.fvm/fvm_config.json b/example/.fvm/fvm_config.json index ad653cd1..8113e786 100644 --- a/example/.fvm/fvm_config.json +++ b/example/.fvm/fvm_config.json @@ -1,7 +1,7 @@ { "flutterSdkVersion": "stable", "flavors": { - "lts": "3.0.0", + "lts": "3.10.0", "main": "stable", "edge": "beta" } diff --git a/example/android/build.gradle b/example/android/build.gradle index 61a47e77..f546a898 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -26,6 +26,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index f6896321..bf9e6955 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -4,7 +4,7 @@ PODS: - Flutter - google_maps_flutter_ios (0.0.1): - Flutter - - GoogleMaps + - GoogleMaps (< 8.0) - GoogleMaps (5.2.0): - GoogleMaps/Maps (= 5.2.0) - GoogleMaps/Base (5.2.0) @@ -36,9 +36,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 geolocator_apple: cc556e6844d508c95df1e87e3ea6fa4e58c50401 - google_maps_flutter_ios: 66201f392bf62d500f07670a30488a247b9bb5b9 + google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693 - package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e + package_info_plus: fd030dabf36271f146f1f3beacd48f564b0f17f7 PODFILE CHECKSUM: ef19549a9bc3046e7bb7d2fab4d021637c0c58a3 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 39784f41..37da7575 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -253,6 +253,7 @@ files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( diff --git a/example/lib/main.dart b/example/lib/main.dart index 5f03595e..6cbe8752 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -176,6 +176,7 @@ class _HomePageState extends State { usePlaceDetailSearch: true, zoomGesturesEnabled: true, zoomControlsEnabled: true, + ignoreLocationPermissionErrors: true, onMapCreated: (GoogleMapController controller) { print("Map created"); }, @@ -333,6 +334,7 @@ class _HomePageState extends State { usePlaceDetailSearch: true, zoomGesturesEnabled: true, zoomControlsEnabled: true, + ignoreLocationPermissionErrors: true, onPlacePicked: (PickResult result) { setState(() { selectedPlace = result; @@ -374,7 +376,6 @@ class _HomePageState extends State { zoomGesturesEnabled: false, zoomControlsEnabled: false, myLocationButtonEnabled: false, - compassEnabled: false, mapToolbarEnabled: false, initialCameraPosition: new CameraPosition( target: HomePage.kInitialPosition, zoom: 15), diff --git a/example/pubspec.lock b/example/pubspec.lock index cfd9cf24..56ccb6ef 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -5,65 +5,82 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons - url: "https://pub.dartlang.org" + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" source: hosted version: "1.0.5" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" flutter: dependency: "direct main" description: flutter @@ -73,9 +90,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" + url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.15" flutter_test: dependency: "direct dev" description: flutter @@ -90,79 +108,106 @@ packages: dependency: transitive description: name: geolocator - url: "https://pub.dartlang.org" + sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" + url: "https://pub.dev" source: hosted version: "9.0.2" geolocator_android: dependency: transitive description: name: geolocator_android - url: "https://pub.dartlang.org" + sha256: b06c72853c993ae533f482d81a12805d7a441f5231d9668718bc7131d7464082 + url: "https://pub.dev" source: hosted - version: "4.1.7" + version: "4.2.0" geolocator_apple: dependency: transitive description: name: geolocator_apple - url: "https://pub.dartlang.org" + sha256: "36527c555f4c425f7d8fa8c7c07d67b78e3ff7590d40448051959e1860c1cfb4" + url: "https://pub.dev" source: hosted - version: "2.2.5" + version: "2.2.7" geolocator_platform_interface: dependency: transitive description: name: geolocator_platform_interface - url: "https://pub.dartlang.org" + sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 + url: "https://pub.dev" source: hosted version: "4.0.7" geolocator_web: dependency: transitive description: name: geolocator_web - url: "https://pub.dartlang.org" + sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 + url: "https://pub.dev" source: hosted version: "2.1.6" geolocator_windows: dependency: transitive description: name: geolocator_windows - url: "https://pub.dartlang.org" + sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d + url: "https://pub.dev" source: hosted version: "0.1.1" google_api_headers: dependency: transitive description: name: google_api_headers - url: "https://pub.dartlang.org" + sha256: "104a73abca28c65b969482077d4c98c871ac38c3dd426a1536287baec50cec01" + url: "https://pub.dev" source: hosted - version: "1.5.0+1" + version: "2.0.0" + google_maps: + dependency: transitive + description: + name: google_maps + sha256: "555d5d736339b0478e821167ac521c810d7b51c3b2734e6802a9f046b64ea37a" + url: "https://pub.dev" + source: hosted + version: "6.3.0" google_maps_flutter: dependency: transitive description: name: google_maps_flutter - url: "https://pub.dartlang.org" + sha256: "7e35644d8a88ad86409976db8fa23ddc7d933f8239e57405e4660534be09acd2" + url: "https://pub.dev" source: hosted - version: "2.2.6" + version: "2.3.1" google_maps_flutter_android: dependency: transitive description: name: google_maps_flutter_android - url: "https://pub.dartlang.org" + sha256: "9512c862df77c1f0fa5f445513dd3c57f5996f0a809dccb74e54b690ee4e3a0f" + url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.15" google_maps_flutter_ios: dependency: transitive description: name: google_maps_flutter_ios - url: "https://pub.dartlang.org" + sha256: a9462a433bf3ebe60aadcf4906d2d6341a270d69d3e0fcaa8eb2b64699fcfb4f + url: "https://pub.dev" source: hosted - version: "2.1.13" + version: "2.2.3" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface - url: "https://pub.dartlang.org" + sha256: cd310faa7fba3df10ab3f852719f832eaa223e4b315ac46af986572d1cec222f + url: "https://pub.dev" + source: hosted + version: "2.3.0" + google_maps_flutter_web: + dependency: transitive + description: + name: google_maps_flutter_web + sha256: "280170a2dcac3364317b5786f0d2e3c4128fdb795bc0d87ffe56226b0cf1f57d" + url: "https://pub.dev" source: hosted - version: "2.2.5" + version: "0.5.1" google_maps_place_picker_mb: dependency: "direct main" description: @@ -174,100 +219,138 @@ packages: dependency: transitive description: name: google_maps_webservice - url: "https://pub.dartlang.org" + sha256: d0ae4e4508afd74a3f051565261a3cdbae59db29448f9b6e6beb5674545e1eb7 + url: "https://pub.dev" source: hosted version: "0.0.20-nullsafety.5" - http: + html: dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" + http: + dependency: "direct overridden" description: name: http - url: "https://pub.dartlang.org" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "1.1.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted version: "4.0.2" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + js_wrapping: + dependency: transitive + description: + name: js_wrapping + sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.7.4" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" package_info_plus: - dependency: transitive + dependency: "direct overridden" description: name: package_info_plus - url: "https://pub.dartlang.org" + sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.0.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" source: hosted version: "2.0.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" provider: dependency: transitive description: name: provider - url: "https://pub.dartlang.org" + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" source: hosted version: "6.0.5" + sanitize_html: + dependency: transitive + description: + name: sanitize_html + sha256: "0a445f19bbaa196f5a4f93461aa066b94e6e025622eb1e9bc77872a5e25233a5" + url: "https://pub.dev" + source: hosted + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -277,86 +360,98 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.5.1" tuple: dependency: transitive description: name: tuple - url: "https://pub.dartlang.org" + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" uuid: dependency: transitive description: name: uuid - url: "https://pub.dartlang.org" + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" source: hosted version: "3.0.7" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee + url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "5.0.5" sdks: - dart: ">=2.18.0 <3.0.0" - flutter: ">=3.0.0" + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index e93f3628..05be4016 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -16,8 +16,8 @@ version: 1.0.0+1 publish_to: none environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: flutter: @@ -34,6 +34,10 @@ dev_dependencies: flutter_test: sdk: flutter +dependency_overrides: + http: any + package_info_plus: any + # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/lib/providers/place_provider.dart b/lib/providers/place_provider.dart index f28d7ff0..126763a0 100644 --- a/lib/providers/place_provider.dart +++ b/lib/providers/place_provider.dart @@ -42,7 +42,7 @@ class PlaceProvider extends ChangeNotifier { LocationAccuracy? desiredAccuracy; bool isAutoCompleteSearching = false; - Future updateCurrentLocation() async { + Future updateCurrentLocation({bool gracefully = false}) async { bool serviceEnabled; LocationPermission permission; @@ -52,6 +52,10 @@ class PlaceProvider extends ChangeNotifier { // Location services are not enabled don't continue // accessing the position and request users of the // App to enable the location services. + if (gracefully) { + // Or you can swallow the issue and respect the user's privacy + return; + } return Future.error('Location services are disabled.'); } @@ -64,12 +68,20 @@ class PlaceProvider extends ChangeNotifier { // Android's shouldShowRequestPermissionRationale // returned true. According to Android guidelines // your App should show an explanatory UI now. + if (gracefully) { + // Or you can swallow the issue and respect the user's privacy + return; + } return Future.error('Location permissions are denied'); } } if (permission == LocationPermission.deniedForever) { // Permissions are denied forever, handle appropriately. + if (gracefully) { + // Or you can swallow the issue and respect the user's privacy + return; + } return Future.error( 'Location permissions are permanently denied, we cannot request permissions.'); } diff --git a/lib/src/autocomplete_search.dart b/lib/src/autocomplete_search.dart index 40e11571..07fc331d 100644 --- a/lib/src/autocomplete_search.dart +++ b/lib/src/autocomplete_search.dart @@ -249,7 +249,7 @@ class AutoCompleteSearchState extends State { ), ); - Overlay.of(context)!.insert(overlayEntry!); + Overlay.of(context).insert(overlayEntry!); } Widget _buildSearchingOverlay() { diff --git a/lib/src/components/prediction_tile.dart b/lib/src/components/prediction_tile.dart index d1a1d6b0..28b4ffe1 100644 --- a/lib/src/components/prediction_tile.dart +++ b/lib/src/components/prediction_tile.dart @@ -26,7 +26,7 @@ class PredictionTile extends StatelessWidget { List _buildPredictionText(BuildContext context) { final List result = []; - final textColor = Theme.of(context).textTheme.bodyText2!.color; + final textColor = Theme.of(context).textTheme.bodyMedium!.color; if (prediction.matchedSubstrings.length > 0) { MatchedSubstring matchedSubString = prediction.matchedSubstrings[0]; diff --git a/lib/src/google_map_place_picker.dart b/lib/src/google_map_place_picker.dart index 61b37169..27670854 100644 --- a/lib/src/google_map_place_picker.dart +++ b/lib/src/google_map_place_picker.dart @@ -403,13 +403,16 @@ class GoogleMapPlacePicker extends StatelessWidget { return Container(); } else { return Positioned( - bottom: 50, - right: 10, + bottom: MediaQuery.of(context).size.height * 0.1 - 3.6, + right: 2, child: Card( elevation: 4.0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12.0), + ), child: Container( - width: 40, - height: 100, + width: MediaQuery.of(context).size.width * 0.15 - 13, + height: 107, child: Column( children: [ IconButton( diff --git a/lib/src/models/circle_area.dart b/lib/src/models/circle_area.dart index f16b5108..74447c7f 100644 --- a/lib/src/models/circle_area.dart +++ b/lib/src/models/circle_area.dart @@ -1,5 +1,3 @@ -import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:uuid/uuid.dart'; diff --git a/lib/src/place_picker.dart b/lib/src/place_picker.dart index 28974a7f..139ca786 100644 --- a/lib/src/place_picker.dart +++ b/lib/src/place_picker.dart @@ -69,6 +69,7 @@ class PlacePicker extends StatefulWidget { this.automaticallyImplyAppBarLeading = true, this.autocompleteOnTrailingWhitespace = false, this.hidePlaceDetailsWhenDraggingPin = true, + this.ignoreLocationPermissionErrors = false, this.onTapBack, this.onCameraMoveStarted, this.onCameraMove, @@ -181,8 +182,13 @@ class PlacePicker extends StatefulWidget { /// Defaults to false. final bool autocompleteOnTrailingWhitespace; + /// Whether to hide place details when dragging pin. Defaults to true. final bool hidePlaceDetailsWhenDraggingPin; + /// Whether to ignore location permission errors. Defaults to false. + /// If this is set to `true` the UI will be blocked. + final bool ignoreLocationPermissionErrors; + // Raised when clicking on the back arrow. // This will not listen for the system back button on Android devices. // If this is not set, but the back button is visible through automaticallyImplyLeading, @@ -220,8 +226,10 @@ class PlacePicker extends StatefulWidget { /// Called when the map type has been changed. final Function(MapType)? onMapTypeChanged; - /// Allow user to make visible the zoom button & toggle on & off zoom gestures + /// Toggle on & off zoom gestures final bool zoomGesturesEnabled; + + /// Allow user to make visible the zoom button final bool zoomControlsEnabled; @override @@ -261,7 +269,8 @@ class _PlacePickerState extends State { provider.desiredAccuracy = widget.desiredLocationAccuracy; provider.setMapType(widget.initialMapType); if (widget.useCurrentLocation != null && widget.useCurrentLocation!) { - await provider.updateCurrentLocation(); + await provider.updateCurrentLocation( + gracefully: widget.ignoreLocationPermissionErrors); } return provider; } @@ -311,7 +320,7 @@ class _PlacePickerState extends State { children.addAll([ Icon( Icons.error_outline, - color: Theme.of(context).errorColor, + color: Theme.of(context).colorScheme.error, ), Padding( padding: const EdgeInsets.only(top: 16), @@ -481,8 +490,8 @@ class _PlacePickerState extends State { Timer(Duration(seconds: widget.myLocationButtonCooldown), () { provider!.isOnUpdateLocationCooldown = false; }); - await provider! - .updateCurrentLocation(); + await provider!.updateCurrentLocation( + gracefully: widget.ignoreLocationPermissionErrors); await _moveToCurrentPosition(); } }, diff --git a/pubspec.lock b/pubspec.lock index 842b3bc7..2bc1afb4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,58 +5,74 @@ packages: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.9.0" + version: "2.11.0" boolean_selector: dependency: transitive description: name: boolean_selector - url: "https://pub.dartlang.org" + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" characters: dependency: transitive description: name: characters - url: "https://pub.dartlang.org" + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted version: "1.1.1" collection: dependency: transitive description: name: collection - url: "https://pub.dartlang.org" + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.17.1" crypto: dependency: transitive description: name: crypto - url: "https://pub.dartlang.org" + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "1.0.0" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted version: "1.3.1" ffi: dependency: transitive description: name: ffi - url: "https://pub.dartlang.org" + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" flutter: dependency: "direct main" description: flutter @@ -66,9 +82,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: "950e77c2bbe1692bc0874fc7fb491b96a4dc340457f4ea1641443d0a6c1ea360" + url: "https://pub.dev" source: hosted - version: "2.0.7" + version: "2.0.15" flutter_test: dependency: "direct dev" description: flutter @@ -83,177 +100,242 @@ packages: dependency: "direct main" description: name: geolocator - url: "https://pub.dartlang.org" + sha256: "5c23f3613f50586c0bbb2b8f970240ae66b3bd992088cf60dd5ee2e6f7dde3a8" + url: "https://pub.dev" source: hosted version: "9.0.2" geolocator_android: dependency: transitive description: name: geolocator_android - url: "https://pub.dartlang.org" + sha256: b06c72853c993ae533f482d81a12805d7a441f5231d9668718bc7131d7464082 + url: "https://pub.dev" source: hosted - version: "4.1.7" + version: "4.2.0" geolocator_apple: dependency: transitive description: name: geolocator_apple - url: "https://pub.dartlang.org" + sha256: "36527c555f4c425f7d8fa8c7c07d67b78e3ff7590d40448051959e1860c1cfb4" + url: "https://pub.dev" source: hosted - version: "2.2.5" + version: "2.2.7" geolocator_platform_interface: dependency: transitive description: name: geolocator_platform_interface - url: "https://pub.dartlang.org" + sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 + url: "https://pub.dev" source: hosted version: "4.0.7" geolocator_web: dependency: transitive description: name: geolocator_web - url: "https://pub.dartlang.org" + sha256: f68a122da48fcfff68bbc9846bb0b74ef651afe84a1b1f6ec20939de4d6860e1 + url: "https://pub.dev" source: hosted version: "2.1.6" geolocator_windows: dependency: transitive description: name: geolocator_windows - url: "https://pub.dartlang.org" + sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d + url: "https://pub.dev" source: hosted version: "0.1.1" google_api_headers: dependency: "direct main" description: name: google_api_headers - url: "https://pub.dartlang.org" + sha256: "104a73abca28c65b969482077d4c98c871ac38c3dd426a1536287baec50cec01" + url: "https://pub.dev" source: hosted - version: "1.5.0+1" + version: "2.0.0" + google_maps: + dependency: transitive + description: + name: google_maps + sha256: "555d5d736339b0478e821167ac521c810d7b51c3b2734e6802a9f046b64ea37a" + url: "https://pub.dev" + source: hosted + version: "6.3.0" google_maps_flutter: dependency: "direct main" description: name: google_maps_flutter - url: "https://pub.dartlang.org" + sha256: "7e35644d8a88ad86409976db8fa23ddc7d933f8239e57405e4660534be09acd2" + url: "https://pub.dev" source: hosted - version: "2.2.6" + version: "2.3.1" google_maps_flutter_android: dependency: transitive description: name: google_maps_flutter_android - url: "https://pub.dartlang.org" + sha256: "9512c862df77c1f0fa5f445513dd3c57f5996f0a809dccb74e54b690ee4e3a0f" + url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.15" google_maps_flutter_ios: dependency: transitive description: name: google_maps_flutter_ios - url: "https://pub.dartlang.org" + sha256: a9462a433bf3ebe60aadcf4906d2d6341a270d69d3e0fcaa8eb2b64699fcfb4f + url: "https://pub.dev" source: hosted - version: "2.1.13" + version: "2.2.3" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface - url: "https://pub.dartlang.org" + sha256: cd310faa7fba3df10ab3f852719f832eaa223e4b315ac46af986572d1cec222f + url: "https://pub.dev" source: hosted - version: "2.2.5" + version: "2.3.0" + google_maps_flutter_web: + dependency: transitive + description: + name: google_maps_flutter_web + sha256: "280170a2dcac3364317b5786f0d2e3c4128fdb795bc0d87ffe56226b0cf1f57d" + url: "https://pub.dev" + source: hosted + version: "0.5.1" google_maps_webservice: dependency: "direct main" description: name: google_maps_webservice - url: "https://pub.dartlang.org" + sha256: d0ae4e4508afd74a3f051565261a3cdbae59db29448f9b6e6beb5674545e1eb7 + url: "https://pub.dev" source: hosted version: "0.0.20-nullsafety.5" + html: + dependency: transitive + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + url: "https://pub.dev" source: hosted - version: "0.13.5" + version: "1.1.0" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" source: hosted version: "4.0.2" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + js_wrapping: + dependency: transitive + description: + name: js_wrapping + sha256: e385980f7c76a8c1c9a560dfb623b890975841542471eade630b2871d243851c + url: "https://pub.dev" source: hosted - version: "0.6.4" + version: "0.7.4" json_annotation: dependency: transitive description: name: json_annotation - url: "https://pub.dartlang.org" + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" source: hosted - version: "4.8.0" + version: "4.8.1" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" source: hosted - version: "0.12.12" + version: "0.12.15" material_color_utilities: dependency: transitive description: name: material_color_utilities - url: "https://pub.dartlang.org" + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.1.5" + version: "0.2.0" meta: dependency: transitive description: name: meta - url: "https://pub.dartlang.org" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" nested: dependency: transitive description: name: nested - url: "https://pub.dartlang.org" + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" source: hosted version: "1.0.0" package_info_plus: - dependency: transitive + dependency: "direct main" description: name: package_info_plus - url: "https://pub.dartlang.org" + sha256: ceb027f6bc6a60674a233b4a90a7658af1aebdea833da0b5b53c1e9821a78c7b + url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "4.0.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - url: "https://pub.dartlang.org" + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" source: hosted version: "2.0.1" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" source: hosted version: "6.0.5" + sanitize_html: + dependency: transitive + description: + name: sanitize_html + sha256: "0a445f19bbaa196f5a4f93461aa066b94e6e025622eb1e9bc77872a5e25233a5" + url: "https://pub.dev" + source: hosted + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -263,86 +345,98 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.9.1" stack_trace: dependency: transitive description: name: stack_trace - url: "https://pub.dartlang.org" + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" stream_channel: dependency: transitive description: name: stream_channel - url: "https://pub.dartlang.org" + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.1" stream_transform: dependency: transitive description: name: stream_transform - url: "https://pub.dartlang.org" + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" source: hosted version: "2.1.0" string_scanner: dependency: transitive description: name: string_scanner - url: "https://pub.dartlang.org" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "1.2.0" term_glyph: dependency: transitive description: name: term_glyph - url: "https://pub.dartlang.org" + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" source: hosted version: "1.2.1" test_api: dependency: transitive description: name: test_api - url: "https://pub.dartlang.org" + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" source: hosted - version: "0.4.12" + version: "0.5.1" tuple: dependency: "direct main" description: name: tuple - url: "https://pub.dartlang.org" + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.2" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" source: hosted - version: "1.3.1" + version: "1.3.2" uuid: dependency: "direct main" description: name: uuid - url: "https://pub.dartlang.org" + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" source: hosted version: "3.0.7" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.4" win32: dependency: transitive description: name: win32 - url: "https://pub.dartlang.org" + sha256: dfdf0136e0aa7a1b474ea133e67cb0154a0acd2599c4f3ada3b49d38d38793ee + url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "5.0.5" sdks: - dart: ">=2.18.0 <3.0.0" - flutter: ">=3.0.0" + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" diff --git a/pubspec.yaml b/pubspec.yaml index baa6f203..7fc9750a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,29 +1,34 @@ name: google_maps_place_picker_mb description: A Flutter plugin which provides 'Picking Place' using Google Maps widget. (MB version) -version: 3.0.2 -homepage: https://github.com/martin-braun/google_maps_place_picker_mb +version: 3.1.0 +homepage: https://github.com/martin-braun-net/google_maps_place_picker_mb environment: - sdk: ">=2.17.0 <3.0.0" - flutter: ">=3.0.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: flutter: sdk: flutter geolocator: ^9.0.2 - google_api_headers: ^1.5.0+1 - google_maps_flutter: ^2.2.6 + google_api_headers: ^2.0.0 + google_maps_flutter: ^2.3.0 google_maps_webservice: ^0.0.20-nullsafety.5 - http: ^0.13.5 + http: ^1.1.0 provider: ^6.0.5 - tuple: ^2.0.1 + tuple: ^2.0.2 uuid: ^3.0.7 + package_info_plus: ^3.1.2 dev_dependencies: flutter_test: sdk: flutter +dependency_overrides: + http: any + package_info_plus: any + flutter: null false_secrets: