diff --git a/android/build.gradle b/android/build.gradle index 68a64275..9ad34124 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,14 +2,14 @@ group 'com.humazed.google_map_location_picker' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.3.31' + ext.kotlin_version = '1.7.10' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath "com.android.tools.build:gradle:7.3.0" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -25,13 +25,13 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 28 + compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - minSdkVersion 16 + minSdkVersion 23 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } lintOptions { diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar index f3d88b1c..e69de29b 100644 Binary files a/android/gradle/wrapper/gradle-wrapper.jar and b/android/gradle/wrapper/gradle-wrapper.jar differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 1b16c34a..0f80bbf5 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/src/main/kotlin/com/humazed/google_map_location_picker/GoogleMapLocationPickerPlugin.kt b/android/src/main/kotlin/com/humazed/google_map_location_picker/GoogleMapLocationPickerPlugin.kt index 58acc245..c9539872 100644 --- a/android/src/main/kotlin/com/humazed/google_map_location_picker/GoogleMapLocationPickerPlugin.kt +++ b/android/src/main/kotlin/com/humazed/google_map_location_picker/GoogleMapLocationPickerPlugin.kt @@ -1,37 +1,37 @@ package com.humazed.google_map_location_picker -import android.app.Activity -import android.content.pm.PackageInfo -import android.content.pm.PackageManager -import androidx.annotation.UiThread +import androidx.annotation.NonNull + +import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result -import io.flutter.plugin.common.PluginRegistry.Registrar +import io.flutter.embedding.engine.plugins.activity.ActivityAware +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding +import android.content.pm.PackageManager import java.math.BigInteger import java.security.MessageDigest +import android.content.pm.PackageInfo +class GoogleMapLocationPickerPlugin : FlutterPlugin, MethodCallHandler, ActivityAware { + private lateinit var channel : MethodChannel + private var activityBinding: ActivityPluginBinding? = null -class GoogleMapLocationPickerPlugin(act: Activity) : MethodCallHandler { - var activity: Activity = act - - companion object { - @JvmStatic - fun registerWith(registrar: Registrar) { - val channel = MethodChannel(registrar.messenger(), "google_map_location_picker") - channel.setMethodCallHandler(GoogleMapLocationPickerPlugin(registrar.activity())) - } + override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { + channel = MethodChannel(flutterPluginBinding.binaryMessenger, "google_map_location_picker") + channel.setMethodCallHandler(this) } - @UiThread - override fun onMethodCall(call: MethodCall, result: Result) { - if (call.method == "getPlatformVersion") { - result.success("Android ${android.os.Build.VERSION.RELEASE}") + override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { + if(activityBinding == null) { + result.notImplemented() + return } if (call.method == "getSigningCertSha1") { try { - val info: PackageInfo = activity.packageManager.getPackageInfo(call.arguments(), PackageManager.GET_SIGNATURES) + //.orEmpty() added on 14/05/22 by mg to call.arguments().orEmpty() + val info: PackageInfo = activityBinding!!.activity.packageManager.getPackageInfo(call.arguments().orEmpty(), PackageManager.GET_SIGNATURES) for (signature in info.signatures) { val md: MessageDigest = MessageDigest.getInstance("SHA1") md.update(signature.toByteArray()) @@ -49,4 +49,22 @@ class GoogleMapLocationPickerPlugin(act: Activity) : MethodCallHandler { result.notImplemented() } } -} + + override fun onDetachedFromEngine(@NonNull binding: FlutterPlugin.FlutterPluginBinding) { + channel.setMethodCallHandler(null) + } + + override fun onAttachedToActivity(binding: ActivityPluginBinding) { + activityBinding = binding + } + + override fun onDetachedFromActivity() { + activityBinding = null + } + + override fun onDetachedFromActivityForConfigChanges() { + } + + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { + } +} \ No newline at end of file diff --git a/example/.gitignore b/example/.gitignore index 8b41f918..b53501bc 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -26,6 +26,7 @@ .pub-cache/ .pub/ /build/ +/lib/api_keys.dart # Android related **/android/**/gradle-wrapper.jar diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 56abd65b..d931ea43 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id("com.android.application") + id("kotlin-android") + id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,12 +27,11 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' + apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 28 + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -39,8 +44,8 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.humazed.google_map_location_picker_example" - minSdkVersion 16 - targetSdkVersion 28 + minSdkVersion 23 + targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index a41588c0..6ef351da 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -14,12 +14,13 @@ additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - + + + + android:value="${MAPS_API_KEY}" /> + diff --git a/example/android/app/src/main/kotlin/com/humazed/google_map_location_picker_example/MainActivity.kt b/example/android/app/src/main/kotlin/com/humazed/google_map_location_picker_example/MainActivity.kt deleted file mode 100644 index 0d3473df..00000000 --- a/example/android/app/src/main/kotlin/com/humazed/google_map_location_picker_example/MainActivity.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.humazed.google_map_location_picker_example - -import android.os.Bundle - -import io.flutter.app.FlutterActivity -import io.flutter.plugins.GeneratedPluginRegistrant - -class MainActivity: FlutterActivity() { - override fun onCreate(savedInstanceState: Bundle?) { - super.onCreate(savedInstanceState) - GeneratedPluginRegistrant.registerWith(this) - } -} diff --git a/example/android/app/src/main/res/values/styles.xml b/example/android/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..1f83a33f --- /dev/null +++ b/example/android/app/src/main/res/values/styles.xml @@ -0,0 +1,18 @@ + + + + + + + diff --git a/example/android/build.gradle b/example/android/build.gradle index 56ace55b..21bfa7e4 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,13 +1,14 @@ buildscript { - ext.kotlin_version = '1.3.61' + ext.kotlin_version = '1.5.0' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.6.3' + classpath "com.android.tools.build:gradle:7.0.2" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0" } } diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 56228224..7606e2d9 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip diff --git a/example/ios/Flutter/flutter_export_environment.sh b/example/ios/Flutter/flutter_export_environment.sh new file mode 100755 index 00000000..c251d3f4 --- /dev/null +++ b/example/ios/Flutter/flutter_export_environment.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# This is a generated file; do not edit or check into version control. +export "FLUTTER_ROOT=/Users/davidbeville/Programming/flutter" +export "FLUTTER_APPLICATION_PATH=/Users/davidbeville/AndroidStudioProjects/google_map_location_picker/example" +export "COCOAPODS_PARALLEL_CODE_SIGN=true" +export "FLUTTER_TARGET=lib/main.dart" +export "FLUTTER_BUILD_DIR=build" +export "FLUTTER_BUILD_NAME=1.0.0" +export "FLUTTER_BUILD_NUMBER=1.0.0" +export "DART_OBFUSCATION=false" +export "TRACK_WIDGET_CREATION=true" +export "TREE_SHAKE_ICONS=false" +export "PACKAGE_CONFIG=.dart_tool/package_config.json" diff --git a/example/lib/generated/i18n.dart b/example/lib/generated/i18n.dart index b5e27a19..5636c73b 100644 --- a/example/lib/generated/i18n.dart +++ b/example/lib/generated/i18n.dart @@ -11,12 +11,12 @@ import 'package:flutter/material.dart'; class S implements WidgetsLocalizations { const S(); - static S current; + static S? current; static const GeneratedLocalizationsDelegate delegate = GeneratedLocalizationsDelegate(); - static S of(BuildContext context) => Localizations.of(context, S); + static S? of(BuildContext context) => Localizations.of(context, S); @override TextDirection get textDirection => TextDirection.ltr; @@ -33,7 +33,7 @@ class $en extends S { const $en(); } -class GeneratedLocalizationsDelegate extends LocalizationsDelegate { +class GeneratedLocalizationsDelegate extends LocalizationsDelegate { const GeneratedLocalizationsDelegate(); List get supportedLocales { @@ -44,8 +44,8 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate { } LocaleListResolutionCallback listResolution( - {Locale fallback, bool withCountry = true}) { - return (List locales, Iterable supported) { + {Locale? fallback, bool withCountry = true}) { + return (List? locales, Iterable supported) { if (locales == null || locales.isEmpty) { return fallback ?? supported.first; } else { @@ -55,29 +55,29 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate { } LocaleResolutionCallback resolution( - {Locale fallback, bool withCountry = true}) { - return (Locale locale, Iterable supported) { + {Locale? fallback, bool withCountry = true}) { + return (Locale? locale, Iterable supported) { return _resolve(locale, fallback, supported, withCountry); }; } @override - Future load(Locale locale) { - final String lang = getLang(locale); + Future load(Locale locale) { + final String? lang = getLang(locale); if (lang != null) { switch (lang) { case "ar": S.current = const $ar(); - return SynchronousFuture(S.current); + return SynchronousFuture(S.current); case "en": S.current = const $en(); - return SynchronousFuture(S.current); + return SynchronousFuture(S.current); default: // NO-OP. } } S.current = const S(); - return SynchronousFuture(S.current); + return SynchronousFuture(S.current); } @override @@ -89,7 +89,7 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate { /// /// Internal method to resolve a locale from a list of locales. /// - Locale _resolve(Locale locale, Locale fallback, Iterable supported, + Locale _resolve(Locale? locale, Locale? fallback, Iterable supported, bool withCountry) { if (locale == null || !_isSupported(locale, withCountry)) { return fallback ?? supported.first; @@ -125,7 +125,7 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate { // If no country requirement is requested, check if this locale has no country. if (true != withCountry && (supportedLocale.countryCode == null || - supportedLocale.countryCode.isEmpty)) { + supportedLocale.countryCode!.isEmpty)) { return true; } } @@ -134,8 +134,8 @@ class GeneratedLocalizationsDelegate extends LocalizationsDelegate { } } -String getLang(Locale l) => l == null +String? getLang(Locale l) => l == null ? null - : l.countryCode != null && l.countryCode.isEmpty + : l.countryCode != null && l.countryCode!.isEmpty ? l.languageCode : l.toString(); diff --git a/example/lib/main.dart b/example/lib/main.dart index 4b345412..3767c9c6 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -3,7 +3,7 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:google_map_location_picker/generated/l10n.dart' as location_picker; import 'package:google_map_location_picker/google_map_location_picker.dart'; -import 'package:google_map_location_picker_example/keys.dart'; +//import 'package:google_map_location_picker_example/api_key.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'generated/i18n.dart'; @@ -16,7 +16,7 @@ class MyApp extends StatefulWidget { } class _MyAppState extends State { - LocationResult _pickedLocation; + LocationResult? _pickedLocation; @override Widget build(BuildContext context) { @@ -50,9 +50,9 @@ class _MyAppState extends State { children: [ RaisedButton( onPressed: () async { - LocationResult result = await showLocationPicker( + LocationResult? result = await showLocationPicker( context, - apiKey, + 'googleMapsApiKeyAndroid', initialCenter: LatLng(31.1975844, 29.9598339), // automaticallyAnimateToCurrentLocation: true, // mapStylePath: 'assets/mapStyle.json', diff --git a/example/pubspec.lock b/example/pubspec.lock index b1713335..4d01269f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -7,14 +7,14 @@ packages: name: android_intent url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" async: dependency: transitive description: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.5.0" + version: "2.9.0" boolean_selector: dependency: transitive description: @@ -28,42 +28,42 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.1" charcode: dependency: transitive description: name: charcode url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" cupertino_icons: dependency: "direct main" description: name: cupertino_icons url: "https://pub.dartlang.org" source: hosted - version: "1.0.0" + version: "1.0.3" fake_async: dependency: transitive description: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -80,7 +80,7 @@ packages: name: flutter_plugin_android_lifecycle url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -97,49 +97,70 @@ packages: name: geolocator url: "https://pub.dartlang.org" source: hosted - version: "6.2.1" + version: "9.0.2" + geolocator_android: + dependency: transitive + description: + name: geolocator_android + url: "https://pub.dartlang.org" + source: hosted + version: "4.1.7" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.5" geolocator_platform_interface: dependency: transitive description: name: geolocator_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.9" + version: "4.0.7" geolocator_web: dependency: transitive description: name: geolocator_web url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.1.6" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" google_map_location_picker: dependency: "direct dev" description: path: ".." relative: true source: path - version: "4.1.6" + version: "4.1.8" google_maps_flutter: dependency: transitive description: name: google_maps_flutter url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.6" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" http: dependency: transitive description: name: http url: "https://pub.dartlang.org" source: hosted - version: "0.13.0" + version: "0.13.3" http_parser: dependency: transitive description: @@ -160,21 +181,28 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.10" + version: "0.12.12" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.5" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0" + version: "1.8.0" nested: dependency: transitive description: @@ -188,21 +216,21 @@ packages: name: package_info url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.0.2" path: dependency: transitive description: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.2" pedantic: dependency: transitive description: name: pedantic url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.11.1" platform: dependency: transitive description: @@ -216,14 +244,14 @@ packages: name: plugin_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.0.3" + version: "2.1.4" provider: dependency: transitive description: name: provider url: "https://pub.dartlang.org" source: hosted - version: "5.0.0" + version: "6.0.4" sky_engine: dependency: transitive description: flutter @@ -235,7 +263,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.9.0" stack_trace: dependency: transitive description: @@ -263,21 +291,21 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.19" + version: "0.4.12" typed_data: dependency: transitive description: @@ -291,7 +319,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.1.2" sdks: - dart: ">=2.12.0-259.9.beta <3.0.0" - flutter: ">=2.0.0" + dart: ">=2.17.0 <3.0.0" + flutter: ">=2.8.0" diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 862594e4..096e2893 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.0 environment: - sdk: ">=2.2.2 <3.0.0" + sdk: '>=2.12.0 <3.0.0' dependencies: flutter: @@ -15,7 +15,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.0 + cupertino_icons: ^1.0.3 dev_dependencies: flutter_test: diff --git a/lib/generated/intl/messages_all.dart b/lib/generated/intl/messages_all.dart index f633e6ff..b22af192 100644 --- a/lib/generated/intl/messages_all.dart +++ b/lib/generated/intl/messages_all.dart @@ -40,7 +40,7 @@ Map _deferredLibraries = { 'tr': () => new Future.value(null), }; -MessageLookupByLibrary _findExact(String localeName) { +MessageLookupByLibrary? _findExact(String localeName) { switch (localeName) { case 'ar': return messages_ar.messages; @@ -91,7 +91,7 @@ bool _messagesExistFor(String locale) { } } -MessageLookupByLibrary _findGeneratedMessagesFor(String locale) { +MessageLookupByLibrary? _findGeneratedMessagesFor(String locale) { var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, onFailure: (_) => null); if (actualLocale == null) return null; diff --git a/lib/generated/intl/messages_ar.dart b/lib/generated/intl/messages_ar.dart index be032a5c..be4ccfb8 100644 --- a/lib/generated/intl/messages_ar.dart +++ b/lib/generated/intl/messages_ar.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'ar'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("تم رفض إذن الوصل الي الموقع الجغرافي"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("تم رفض إذن الوصل الي الموقع الجغرافي بشكل نهائي"), diff --git a/lib/generated/intl/messages_de.dart b/lib/generated/intl/messages_de.dart index 2b6ee3f8..b8df1d3f 100644 --- a/lib/generated/intl/messages_de.dart +++ b/lib/generated/intl/messages_de.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'de'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Zugriff auf Standort verweigert"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Zugriff auf Standort permanent verweigert"), diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 5bd6290e..dba6fb53 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'en'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Access to location denied"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Access to location permanently denied"), diff --git a/lib/generated/intl/messages_es.dart b/lib/generated/intl/messages_es.dart index 0a301e0c..858ed892 100644 --- a/lib/generated/intl/messages_es.dart +++ b/lib/generated/intl/messages_es.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'es'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Acceso a la ubicación denegado"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Acceso a la ubicación denegado permanentemente"), diff --git a/lib/generated/intl/messages_fr.dart b/lib/generated/intl/messages_fr.dart index c3924468..fdd2d342 100644 --- a/lib/generated/intl/messages_fr.dart +++ b/lib/generated/intl/messages_fr.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'fr'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Accès à l\'emplacement refusé"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Accès à l\'emplacement refusé définitivement"), diff --git a/lib/generated/intl/messages_it.dart b/lib/generated/intl/messages_it.dart index 969dbf5a..f22c4622 100644 --- a/lib/generated/intl/messages_it.dart +++ b/lib/generated/intl/messages_it.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'it'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Accesso alla posizione rifiutato"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Accesso alla posizione rifiutato permanentemente"), diff --git a/lib/generated/intl/messages_pt.dart b/lib/generated/intl/messages_pt.dart index 869c0e3c..1b178bf0 100644 --- a/lib/generated/intl/messages_pt.dart +++ b/lib/generated/intl/messages_pt.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'pt'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Acesso ao local negado"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Acesso ao local negado permanentemente"), diff --git a/lib/generated/intl/messages_ru.dart b/lib/generated/intl/messages_ru.dart index ad0dd019..a4e5c343 100644 --- a/lib/generated/intl/messages_ru.dart +++ b/lib/generated/intl/messages_ru.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'ru'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Доступ к местоположению запрещен"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Доступ к местоположению запрещен навсегда"), diff --git a/lib/generated/intl/messages_sr.dart b/lib/generated/intl/messages_sr.dart index f7120d17..d2f40758 100644 --- a/lib/generated/intl/messages_sr.dart +++ b/lib/generated/intl/messages_sr.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'sr'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Onemogućen pristup lokaciji"), "allow_access_to_the_location_services" : MessageLookupByLibrary.simpleMessage("Omogućite pristup Vašoj lokaciji"), diff --git a/lib/generated/intl/messages_tr.dart b/lib/generated/intl/messages_tr.dart index 690a4d2a..87db67f6 100644 --- a/lib/generated/intl/messages_tr.dart +++ b/lib/generated/intl/messages_tr.dart @@ -19,7 +19,7 @@ typedef String MessageIfAbsent(String messageStr, List args); class MessageLookup extends MessageLookupByLibrary { String get localeName => 'tr'; - final messages = _notInlinedMessages(_notInlinedMessages); + final Map messages = _notInlinedMessages(_notInlinedMessages); static _notInlinedMessages(_) => { "access_to_location_denied" : MessageLookupByLibrary.simpleMessage("Konum erişimi reddedildi"), "access_to_location_permanently_denied" : MessageLookupByLibrary.simpleMessage("Konuma erişim kalıcı olarak reddedildi"), diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index 5591ce10..3558b672 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -15,7 +15,7 @@ import 'intl/messages_all.dart'; class S { S(); - static S current; + static late S current; static const AppLocalizationDelegate delegate = AppLocalizationDelegate(); @@ -31,7 +31,7 @@ class S { }); } - static S of(BuildContext context) { + static S? of(BuildContext context) { return Localizations.of(context, S); } diff --git a/lib/src/google_map_location_picker.dart b/lib/src/google_map_location_picker.dart index b06dfda0..aa74ac0e 100644 --- a/lib/src/google_map_location_picker.dart +++ b/lib/src/google_map_location_picker.dart @@ -22,7 +22,7 @@ import 'utils/location_utils.dart'; class LocationPicker extends StatefulWidget { LocationPicker( this.apiKey, { - Key key, + Key? key, this.initialCenter, this.initialZoom, this.requiredGPS, @@ -44,28 +44,28 @@ class LocationPicker extends StatefulWidget { final String apiKey; - final LatLng initialCenter; - final double initialZoom; - final List countries; + final LatLng? initialCenter; + final double? initialZoom; + final List? countries; - final bool requiredGPS; - final bool myLocationButtonEnabled; - final bool layersButtonEnabled; - final bool automaticallyAnimateToCurrentLocation; + final bool? requiredGPS; + final bool? myLocationButtonEnabled; + final bool? layersButtonEnabled; + final bool? automaticallyAnimateToCurrentLocation; - final String mapStylePath; + final String? mapStylePath; - final Color appBarColor; - final BoxDecoration searchBarBoxDecoration; - final String hintText; - final Widget resultCardConfirmIcon; - final Alignment resultCardAlignment; - final Decoration resultCardDecoration; - final EdgeInsets resultCardPadding; + final Color? appBarColor; + final BoxDecoration? searchBarBoxDecoration; + final String? hintText; + final Widget? resultCardConfirmIcon; + final Alignment? resultCardAlignment; + final Decoration? resultCardDecoration; + final EdgeInsets? resultCardPadding; - final String language; + final String? language; - final LocationAccuracy desiredAccuracy; + final LocationAccuracy? desiredAccuracy; @override LocationPickerState createState() => LocationPickerState(); @@ -73,12 +73,12 @@ class LocationPicker extends StatefulWidget { class LocationPickerState extends State { /// Result returned after user completes selection - LocationResult locationResult; + LocationResult? locationResult; /// Overlay to display autocomplete suggestions - OverlayEntry overlayEntry; + OverlayEntry? overlayEntry; - List nearbyPlaces = List(); + List nearbyPlaces = []; /// Session token required for autocomplete API call String sessionToken = Uuid().generateV4(); @@ -94,7 +94,7 @@ class LocationPickerState extends State { /// Hides the autocomplete overlay void clearOverlay() { if (overlayEntry != null) { - overlayEntry.remove(); + overlayEntry!.remove(); overlayEntry = null; } } @@ -112,14 +112,15 @@ class LocationPickerState extends State { if (place.length < 1) return; - final RenderBox renderBox = context.findRenderObject(); + final RenderBox renderBox = context.findRenderObject() as RenderBox; Size size = renderBox.size; - final RenderBox appBarBox = appBarKey.currentContext.findRenderObject(); + final RenderBox? appBarBox = + appBarKey.currentContext!.findRenderObject() as RenderBox?; overlayEntry = OverlayEntry( builder: (context) => Positioned( - top: appBarBox.size.height, + top: appBarBox!.size.height, width: size.width, child: Material( elevation: 1, @@ -146,7 +147,7 @@ class LocationPickerState extends State { ), ); - Overlay.of(context).insert(overlayEntry); + Overlay.of(context)!.insert(overlayEntry!); autoCompleteSearch(place); } @@ -159,7 +160,7 @@ class LocationPickerState extends State { // Currently, you can use components to filter by up to 5 countries. from https://developers.google.com/places/web-service/autocomplete String regionParam = countries?.isNotEmpty == true - ? "&components=country:${countries.sublist(0, min(countries.length, 5)).join('|country:')}" + ? "&components=country:${countries!.sublist(0, min(countries.length, 5)).join('|country:')}" : ""; var endpoint = @@ -169,12 +170,13 @@ class LocationPickerState extends State { "language=${widget.language}"; if (locationResult != null) { - endpoint += "&location=${locationResult.latLng.latitude}," + - "${locationResult.latLng.longitude}"; + endpoint += "&location=${locationResult!.latLng!.latitude}," + + "${locationResult!.latLng!.longitude}"; } LocationUtils.getAppHeaders() - .then((headers) => http.get(Uri.parse(endpoint), headers: headers)) + .then((headers) => http.get(Uri.parse(endpoint), + headers: headers as Map?)) .then((response) { if (response.statusCode == 200) { Map data = jsonDecode(response.body); @@ -214,7 +216,7 @@ class LocationPickerState extends State { /// To navigate to the selected place from the autocomplete list to the map, /// the lat,lng is required. This method fetches the lat,lng of the place and /// proceeds to moving the map to that location. - void decodeAndSelectPlace(String placeId) { + void decodeAndSelectPlace(String? placeId) { clearOverlay(); final endpoint = @@ -223,7 +225,8 @@ class LocationPickerState extends State { '&language=${widget.language}'; LocationUtils.getAppHeaders() - .then((headers) => http.get(Uri.parse(endpoint), headers: headers)) + .then((headers) => http.get(Uri.parse(endpoint), + headers: headers as Map?)) .then((response) { if (response.statusCode == 200) { Map location = @@ -240,17 +243,18 @@ class LocationPickerState extends State { /// Display autocomplete suggestions with the overlay. void displayAutoCompleteSuggestions(List suggestions) { - final RenderBox renderBox = context.findRenderObject(); + final RenderBox renderBox = context.findRenderObject() as RenderBox; Size size = renderBox.size; - final RenderBox appBarBox = appBarKey.currentContext.findRenderObject(); + final RenderBox? appBarBox = + appBarKey.currentContext!.findRenderObject() as RenderBox?; clearOverlay(); overlayEntry = OverlayEntry( builder: (context) => Positioned( width: size.width, - top: appBarBox.size.height, + top: appBarBox!.size.height, child: Material( elevation: 1, child: Column( @@ -260,7 +264,7 @@ class LocationPickerState extends State { ), ); - Overlay.of(context).insert(overlayEntry); + Overlay.of(context)!.insert(overlayEntry!); } /// Utility function to get clean readable name of a location. First checks @@ -292,7 +296,8 @@ class LocationPickerState extends State { "location=${latLng.latitude},${latLng.longitude}&radius=150" + "&language=${widget.language}"; - return http.get(Uri.parse(endpoint), headers: headers); + return http.get(Uri.parse(endpoint), + headers: headers as Map?); }).then((response) { if (response.statusCode == 200) { nearbyPlaces.clear(); @@ -330,21 +335,24 @@ class LocationPickerState extends State { "&language=${widget.language}"; final response = await http.get(Uri.parse(endpoint), - headers: await LocationUtils.getAppHeaders()); + headers: await (LocationUtils.getAppHeaders() + as FutureOr?>)); if (response.statusCode == 200) { Map responseJson = jsonDecode(response.body); - String road; + String? formattedAddress; + List>? addressComponents; + //see https://developers.google.com/maps/documentation/geocoding/start - String placeId = responseJson['results'][0]['place_id']; + String? placeId = responseJson['results'][0]['place_id']; if (responseJson['status'] == 'REQUEST_DENIED') { - road = 'REQUEST DENIED = please see log for more details'; + formattedAddress = 'REQUEST DENIED = please see log for more details'; print(responseJson['error_message']); } else { - road = - responseJson['results'][0]['address_components'][0]['short_name']; + addressComponents = responseJson['results'][0]['address_components']; + formattedAddress = responseJson['results'][0]['formatted_address']; } // String locality = @@ -352,9 +360,45 @@ class LocationPickerState extends State { setState(() { locationResult = LocationResult(); - locationResult.address = road; - locationResult.latLng = latLng; - locationResult.placeId = placeId; + locationResult!.formattedAddress = formattedAddress; + locationResult!.latLng = latLng; + locationResult!.placeId = placeId; + if (addressComponents != null) { + addressComponents.forEach((item) { + List? types = item['types']; + if (types != null && types.length > 0) { + switch (types[0]) { + case 'street_number': + locationResult!.streetNumber = item['long_name']; + break; + case 'route': + locationResult!.route = item['long_name']; + break; + case 'sublocality': + case 'sublocality_level_1': + locationResult!.subLocality = item['long_name']; + break; + case 'locality': + locationResult!.locality = item['long_name']; + break; + case 'administrative_area_level_1': + locationResult!.administrativeAreaLevel1 = item['long_name']; + break; + case 'administrative_area_level_2': + locationResult!.administrativeAreaLevel2 = item['long_name']; + break; + case 'country': + locationResult!.country = item['long_name']; + break; + case 'postal_code': + locationResult!.postalCode = item['long_name']; + break; + default: + break; + } + } + }); + } }); } } @@ -362,7 +406,7 @@ class LocationPickerState extends State { /// Moves the camera to the provided location and updates other UI features to /// match the location. void moveToLocation(LatLng latLng) { - mapKey.currentState.mapController.future.then((controller) { + mapKey.currentState!.mapController.future.then((controller) { controller.animateCamera( CameraUpdate.newCameraPosition( CameraPosition( @@ -373,9 +417,9 @@ class LocationPickerState extends State { ); }); - reverseGeocodeLatLng(latLng); + //reverseGeocodeLatLng(latLng); //db 13/03/22 : method interesting but not used so create Google charges for nothing - getNearbyPlaces(latLng); + //getNearbyPlaces(latLng);//db 13/03/22 : method interesting but not used so create Google charges for nothing } @override @@ -442,24 +486,24 @@ class LocationPickerState extends State { /// set [automaticallyAnimateToCurrentLocation] to false. /// /// -Future showLocationPicker( +Future showLocationPicker( BuildContext context, String apiKey, { - LatLng initialCenter = const LatLng(45.521563, -122.677433), + LatLng initialCenter = const LatLng(48.81573732077871, 2.277692232201326), double initialZoom = 16, bool requiredGPS = false, - List countries, + List? countries, bool myLocationButtonEnabled = false, bool layersButtonEnabled = false, bool automaticallyAnimateToCurrentLocation = true, - String mapStylePath, + String? mapStylePath, Color appBarColor = Colors.transparent, - BoxDecoration searchBarBoxDecoration, - String hintText, - Widget resultCardConfirmIcon, - AlignmentGeometry resultCardAlignment, - EdgeInsetsGeometry resultCardPadding, - Decoration resultCardDecoration, + BoxDecoration? searchBarBoxDecoration, + String? hintText, + Widget? resultCardConfirmIcon, + AlignmentGeometry? resultCardAlignment, + EdgeInsetsGeometry? resultCardPadding, + Decoration? resultCardDecoration, String language = 'en', LocationAccuracy desiredAccuracy = LocationAccuracy.best, }) async { @@ -481,8 +525,8 @@ Future showLocationPicker( hintText: hintText, searchBarBoxDecoration: searchBarBoxDecoration, resultCardConfirmIcon: resultCardConfirmIcon, - resultCardAlignment: resultCardAlignment, - resultCardPadding: resultCardPadding, + resultCardAlignment: resultCardAlignment as Alignment?, + resultCardPadding: resultCardPadding as EdgeInsets?, resultCardDecoration: resultCardDecoration, countries: countries, language: language, diff --git a/lib/src/map.dart b/lib/src/map.dart index eca20b2c..75385ee7 100644 --- a/lib/src/map.dart +++ b/lib/src/map.dart @@ -1,9 +1,7 @@ import 'dart:async'; import 'dart:convert'; - -import 'package:android_intent/android_intent.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; +//import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:flutter/services.dart' show rootBundle; import 'package:geolocator/geolocator.dart'; @@ -21,7 +19,7 @@ import 'utils/location_utils.dart'; class MapPicker extends StatefulWidget { const MapPicker( this.apiKey, { - Key key, + Key? key, this.initialCenter, this.initialZoom, this.requiredGPS, @@ -42,27 +40,27 @@ class MapPicker extends StatefulWidget { final String apiKey; - final LatLng initialCenter; - final double initialZoom; + final LatLng? initialCenter; + final double? initialZoom; - final bool requiredGPS; - final bool myLocationButtonEnabled; - final bool layersButtonEnabled; - final bool automaticallyAnimateToCurrentLocation; + final bool? requiredGPS; + final bool? myLocationButtonEnabled; + final bool? layersButtonEnabled; + final bool? automaticallyAnimateToCurrentLocation; - final String mapStylePath; + final String? mapStylePath; - final Color appBarColor; - final BoxDecoration searchBarBoxDecoration; - final String hintText; - final Widget resultCardConfirmIcon; - final Alignment resultCardAlignment; - final Decoration resultCardDecoration; - final EdgeInsets resultCardPadding; + final Color? appBarColor; + final BoxDecoration? searchBarBoxDecoration; + final String? hintText; + final Widget? resultCardConfirmIcon; + final Alignment? resultCardAlignment; + final Decoration? resultCardDecoration; + final EdgeInsets? resultCardPadding; - final String language; + final String? language; - final LocationAccuracy desiredAccuracy; + final LocationAccuracy? desiredAccuracy; @override MapPickerState createState() => MapPickerState(); @@ -73,15 +71,17 @@ class MapPickerState extends State { MapType _currentMapType = MapType.normal; - String _mapStyle; + String? _mapStyle; - LatLng _lastMapPosition; + LatLng? _lastMapPosition; - Position _currentPosition; + Position? _currentPosition; - String _address; + String? _address; + List? _addressComponents; - String _placeId; + String? _placeId; + late ButtonStyle flatButtonStyle; void _onToggleMapTypePressed() { final MapType nextType = @@ -92,10 +92,10 @@ class MapPickerState extends State { // this also checks for location permission. Future _initCurrentLocation() async { - Position currentPosition; + Position? currentPosition; try { - currentPosition = - await getCurrentPosition(desiredAccuracy: widget.desiredAccuracy); + currentPosition = await Geolocator.getCurrentPosition( + desiredAccuracy: widget.desiredAccuracy!); d("position = $currentPosition"); setState(() => _currentPosition = currentPosition); @@ -124,11 +124,11 @@ class MapPickerState extends State { @override void initState() { super.initState(); - if (widget.automaticallyAnimateToCurrentLocation && !widget.requiredGPS) + if (widget.automaticallyAnimateToCurrentLocation! && !widget.requiredGPS!) _initCurrentLocation(); if (widget.mapStylePath != null) { - rootBundle.loadString(widget.mapStylePath).then((string) { + rootBundle.loadString(widget.mapStylePath!).then((string) { _mapStyle = string; }); } @@ -136,7 +136,18 @@ class MapPickerState extends State { @override Widget build(BuildContext context) { - if (widget.requiredGPS) { + ThemeData theme = Theme.of(context); + flatButtonStyle = TextButton.styleFrom( + primary: Colors.white, + //minimumSize: Size(88, 44), + padding: EdgeInsets.symmetric(horizontal: 16.0), + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(2.0)), + ), + backgroundColor: theme.primaryColor, + ); + + if (widget.requiredGPS!) { _checkGeolocationPermission(); if (_currentPosition == null) _initCurrentLocation(); } @@ -148,8 +159,8 @@ class MapPickerState extends State { body: Builder( builder: (context) { if (_currentPosition == null && - widget.automaticallyAnimateToCurrentLocation && - widget.requiredGPS) { + widget.automaticallyAnimateToCurrentLocation! && + widget.requiredGPS!) { return const Center(child: CircularProgressIndicator()); } @@ -166,8 +177,8 @@ class MapPickerState extends State { GoogleMap( myLocationButtonEnabled: false, initialCameraPosition: CameraPosition( - target: widget.initialCenter, - zoom: widget.initialZoom, + target: widget.initialCenter!, + zoom: widget.initialZoom!, ), onMapCreated: (GoogleMapController controller) { mapController.complete(controller); @@ -226,7 +237,7 @@ class MapPickerState extends State { children: [ Flexible( flex: 20, - child: FutureLoadingBuilder>( + child: FutureLoadingBuilder?>( future: getAddress(locationProvider.lastIdleLocation), mutable: true, loadingIndicator: Row( @@ -236,8 +247,10 @@ class MapPickerState extends State { ], ), builder: (context, data) { - _address = data["address"]; + _address = data!["address"]; _placeId = data["placeId"]; + _addressComponents = data["address_components"]; + return Text( _address ?? S.of(context)?.unnamedPlace ?? @@ -250,13 +263,51 @@ class MapPickerState extends State { Spacer(), FloatingActionButton( onPressed: () { - Navigator.of(context).pop({ - 'location': LocationResult( - latLng: locationProvider.lastIdleLocation, - address: _address, - placeId: _placeId, - ) - }); + LocationResult locationResult = LocationResult( + latLng: locationProvider.lastIdleLocation, + formattedAddress: _address, + placeId: _placeId, + ); + if (_addressComponents != null) { + _addressComponents!.forEach((element) { + Map item = element; + if (item['types'] != null && + item['types'].length > 0) { + switch (item['types'][0]) { + case 'street_number': + locationResult.streetNumber = item['long_name']; + break; + case 'route': + locationResult.route = item['long_name']; + break; + case 'sublocality': + case 'sublocality_level_1': + locationResult.subLocality = item['long_name']; + break; + case 'locality': + locationResult.locality = item['long_name']; + break; + case 'administrative_area_level_1': + locationResult.administrativeAreaLevel1 = + item['long_name']; + break; + case 'administrative_area_level_2': + locationResult.administrativeAreaLevel2 = + item['long_name']; + break; + case 'country': + locationResult.country = item['long_name']; + break; + case 'postal_code': + locationResult.postalCode = item['long_name']; + break; + default: + break; + } + } + }); + } + Navigator.of(context).pop({'location': locationResult}); }, child: widget.resultCardConfirmIcon ?? Icon(Icons.arrow_forward), @@ -270,22 +321,25 @@ class MapPickerState extends State { ); } - Future> getAddress(LatLng location) async { + Future?> getAddress(LatLng? location) async { try { final endpoint = 'https://maps.googleapis.com/maps/api/geocode/json?latlng=${location?.latitude},${location?.longitude}' '&key=${widget.apiKey}&language=${widget.language}'; final response = jsonDecode((await http.get(Uri.parse(endpoint), - headers: await LocationUtils.getAppHeaders())) + headers: await (LocationUtils.getAppHeaders()))) .body); + print("BLB data $response"); + return { "placeId": response['results'][0]['place_id'], - "address": response['results'][0]['formatted_address'] + "address": response['results'][0]['formatted_address'], + "address_components": response['results'][0]['address_components'] }; } catch (e) { - print(e); + print("BLB $e"); } return {"placeId": null, "address": null}; @@ -324,7 +378,7 @@ class MapPickerState extends State { var dialogOpen; Future _checkGeolocationPermission() async { - final geolocationStatus = await checkPermission(); + final geolocationStatus = await Geolocator.checkPermission(); d("geolocationStatus = $geolocationStatus"); if (geolocationStatus == LocationPermission.denied && dialogOpen == null) { @@ -361,7 +415,8 @@ class MapPickerState extends State { S.of(context)?.allow_access_to_the_location_services ?? 'Allow access to the location services.'), actions: [ - FlatButton( + TextButton( + style: flatButtonStyle, child: Text(S.of(context)?.ok ?? 'Ok'), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); @@ -395,11 +450,12 @@ class MapPickerState extends State { ?.allow_access_to_the_location_services_from_settings ?? 'Allow access to the location services for this App using the device settings.'), actions: [ - FlatButton( + TextButton( + style: flatButtonStyle, child: Text(S.of(context)?.ok ?? 'Ok'), onPressed: () { Navigator.of(context, rootNavigator: true).pop(); - openAppSettings(); + Geolocator.openAppSettings(); dialogOpen = null; }, ), @@ -409,54 +465,20 @@ class MapPickerState extends State { }, ); } - - // TODO: 9/12/2020 this is no longer needed, remove in the next release - Future _checkGps() async { - if (!(await isLocationServiceEnabled())) { - if (Theme.of(context).platform == TargetPlatform.android) { - showDialog( - context: context, - barrierDismissible: false, - builder: (BuildContext context) { - return AlertDialog( - title: Text(S.of(context)?.cant_get_current_location ?? - "Can't get current location"), - content: Text(S - .of(context) - ?.please_make_sure_you_enable_gps_and_try_again ?? - 'Please make sure you enable GPS and try again'), - actions: [ - FlatButton( - child: Text('Ok'), - onPressed: () { - final AndroidIntent intent = AndroidIntent( - action: 'android.settings.LOCATION_SOURCE_SETTINGS'); - - intent.launch(); - Navigator.of(context, rootNavigator: true).pop(); - }, - ), - ], - ); - }, - ); - } - } - } } class _MapFabs extends StatelessWidget { const _MapFabs({ - Key key, - @required this.myLocationButtonEnabled, - @required this.layersButtonEnabled, - @required this.onToggleMapTypePressed, - @required this.onMyLocationPressed, - }) : assert(onToggleMapTypePressed != null), + Key? key, + required this.myLocationButtonEnabled, + required this.layersButtonEnabled, + required this.onToggleMapTypePressed, + required this.onMyLocationPressed, + }) : //assert(onToggleMapTypePressed != null), super(key: key); - final bool myLocationButtonEnabled; - final bool layersButtonEnabled; + final bool? myLocationButtonEnabled; + final bool? layersButtonEnabled; final VoidCallback onToggleMapTypePressed; final VoidCallback onMyLocationPressed; @@ -468,7 +490,7 @@ class _MapFabs extends StatelessWidget { margin: const EdgeInsets.only(top: kToolbarHeight + 24, right: 8), child: Column( children: [ - if (layersButtonEnabled) + if (layersButtonEnabled!) FloatingActionButton( onPressed: onToggleMapTypePressed, materialTapTargetSize: MaterialTapTargetSize.padded, @@ -476,7 +498,7 @@ class _MapFabs extends StatelessWidget { child: const Icon(Icons.layers), heroTag: "layers", ), - if (myLocationButtonEnabled) + if (myLocationButtonEnabled!) FloatingActionButton( onPressed: onMyLocationPressed, materialTapTargetSize: MaterialTapTargetSize.padded, diff --git a/lib/src/model/auto_comp_iete_item.dart b/lib/src/model/auto_comp_iete_item.dart index 6d5d840f..7ce61b80 100644 --- a/lib/src/model/auto_comp_iete_item.dart +++ b/lib/src/model/auto_comp_iete_item.dart @@ -2,17 +2,17 @@ /// into this model. class AutoCompleteItem { /// The id of the place. This helps to fetch the lat,lng of the place. - String id; + String? id; /// The text (name of place) displayed in the autocomplete suggestions list. - String text; + String? text; /// Assistive index to begin highlight of matched part of the [text] with /// the original query - int offset; + int? offset; /// Length of matched part of the [text] - int length; + int? length; @override String toString() { diff --git a/lib/src/model/location_result.dart b/lib/src/model/location_result.dart index b8c3248f..0e2867f0 100644 --- a/lib/src/model/location_result.dart +++ b/lib/src/model/location_result.dart @@ -5,18 +5,39 @@ class LocationResult { /// The human readable name of the location. This is primarily the /// name of the road. But in cases where the place was selected from Nearby /// places list, we use the name provided on the list item. - String address; // or road + String? formattedAddress; // or road /// Google Maps place ID - String placeId; + String? placeId; /// Latitude/Longitude of the selected location. - LatLng latLng; + LatLng? latLng; - LocationResult({this.latLng, this.address, this.placeId}); + ///streetNumber,route,locality,administrativeAreaLevel2,administrativeAreaLevel1,country of the selected location. + String? streetNumber; + String? route; + String? locality; + String? subLocality; + String? administrativeAreaLevel2; + String? administrativeAreaLevel1; + String? country; + String? postalCode; + + LocationResult( + {this.latLng, + this.formattedAddress, + this.placeId, + this.streetNumber, + this.route, + this.locality, + this.subLocality, + this.administrativeAreaLevel2, + this.administrativeAreaLevel1, + this.country, + this.postalCode}); @override String toString() { - return 'LocationResult{address: $address, latLng: $latLng, placeId: $placeId}'; + return 'LocationResult{formattedAddress: $formattedAddress, latLng: $latLng, placeId: $placeId, streetNumber: $streetNumber, route: $route, locality: $locality,subLocality $subLocality, administrativeAreaLevel2: $administrativeAreaLevel2, administrativeAreaLevel1: $administrativeAreaLevel1, country: $country, postalCode: $postalCode}'; } } diff --git a/lib/src/model/nearby_place.dart b/lib/src/model/nearby_place.dart index 6a18f216..a243422a 100644 --- a/lib/src/model/nearby_place.dart +++ b/lib/src/model/nearby_place.dart @@ -3,15 +3,15 @@ import 'package:google_maps_flutter/google_maps_flutter.dart'; /// Nearby place data will be deserialized into this model. class NearbyPlace { /// The human-readable name of the location provided. This value is provided - /// for [LocationResult.address] when the user selects this nearby place. - String name; + /// for [LocationResult.formattedAddress] when the user selects this nearby place. + String? name; /// The icon identifying the kind of place provided. Eg. lodging, chapel, /// hospital, etc. - String icon; + String? icon; // Latitude/Longitude of the provided location. - LatLng latLng; + LatLng? latLng; @override String toString() { diff --git a/lib/src/providers/location_provider.dart b/lib/src/providers/location_provider.dart index df4b2aef..0ef16d33 100644 --- a/lib/src/providers/location_provider.dart +++ b/lib/src/providers/location_provider.dart @@ -6,11 +6,11 @@ class LocationProvider extends ChangeNotifier { static LocationProvider of(BuildContext context, {bool listen = true}) => Provider.of(context, listen: listen); - LatLng _lastIdleLocation; + LatLng? _lastIdleLocation; - LatLng get lastIdleLocation => _lastIdleLocation; + LatLng? get lastIdleLocation => _lastIdleLocation; - void setLastIdleLocation(LatLng lastIdleLocation) { + void setLastIdleLocation(LatLng? lastIdleLocation) { if (_lastIdleLocation != lastIdleLocation) { _lastIdleLocation = lastIdleLocation; notifyListeners(); diff --git a/lib/src/rich_suggestion.dart b/lib/src/rich_suggestion.dart index a7472641..bc4d33c0 100644 --- a/lib/src/rich_suggestion.dart +++ b/lib/src/rich_suggestion.dart @@ -33,7 +33,7 @@ class RichSuggestion extends StatelessWidget { final List result = []; String startText = - autoCompleteItem.text.substring(0, autoCompleteItem.offset); + autoCompleteItem.text!.substring(0, autoCompleteItem.offset); if (startText.isNotEmpty) { result.add( TextSpan( @@ -47,8 +47,8 @@ class RichSuggestion extends StatelessWidget { ); } - String boldText = autoCompleteItem.text.substring(autoCompleteItem.offset, - autoCompleteItem.offset + autoCompleteItem.length); + String boldText = autoCompleteItem.text!.substring(autoCompleteItem.offset!, + autoCompleteItem.offset! + autoCompleteItem.length!); result.add( TextSpan( @@ -63,8 +63,8 @@ class RichSuggestion extends StatelessWidget { String remainingText = this .autoCompleteItem - .text - .substring(autoCompleteItem.offset + autoCompleteItem.length); + .text! + .substring(autoCompleteItem.offset! + autoCompleteItem.length!); result.add( TextSpan( text: remainingText, diff --git a/lib/src/search_input.dart b/lib/src/search_input.dart index 9d7ba047..00041dea 100644 --- a/lib/src/search_input.dart +++ b/lib/src/search_input.dart @@ -7,16 +7,16 @@ import 'package:google_map_location_picker/generated/l10n.dart'; class SearchInput extends StatefulWidget { SearchInput( this.onSearchInput, { - Key key, + Key? key, this.searchInputKey, this.boxDecoration, this.hintText, }) : super(key: key); final ValueChanged onSearchInput; - final Key searchInputKey; - final BoxDecoration boxDecoration; - final String hintText; + final Key? searchInputKey; + final BoxDecoration? boxDecoration; + final String? hintText; @override State createState() => SearchInputState(); @@ -25,7 +25,7 @@ class SearchInput extends StatefulWidget { class SearchInputState extends State { TextEditingController editController = TextEditingController(); - Timer debouncer; + Timer? debouncer; bool hasSearchEntry = false; @@ -51,7 +51,7 @@ class SearchInputState extends State { } if (debouncer?.isActive ?? false) { - debouncer.cancel(); + debouncer!.cancel(); } debouncer = Timer(Duration(milliseconds: 500), () { diff --git a/lib/src/utils/loading_builder.dart b/lib/src/utils/loading_builder.dart index ec1d09ce..1eb87a24 100644 --- a/lib/src/utils/loading_builder.dart +++ b/lib/src/utils/loading_builder.dart @@ -10,10 +10,10 @@ typedef WidgetBuilder = Widget Function(BuildContext context, T snapshot); class FutureLoadingBuilder extends StatefulWidget { const FutureLoadingBuilder({ - Key key, - @required this.future, + Key? key, + required this.future, this.initialData, - @required this.builder, + required this.builder, this.mutable = false, this.loadingIndicator, }) : assert(builder != null), @@ -26,7 +26,7 @@ class FutureLoadingBuilder extends StatefulWidget { /// null, the data provided to the [builder] will be set to [initialData]. final Future future; - final WidgetBuilder builder; + final WidgetBuilder? builder; /// The data that will be used to create the snapshots provided until a /// non-null [future] has completed. @@ -35,22 +35,22 @@ class FutureLoadingBuilder extends StatefulWidget { /// provided to the [builder] will become null, regardless of [initialData]. /// (The error itself will be available in [AsyncSnapshot.error], and /// [AsyncSnapshot.hasError] will be true.) - final T initialData; + final T? initialData; /// default is true /// /// set to false if the future will change. final bool mutable; - final Widget loadingIndicator; + final Widget? loadingIndicator; @override _FutureLoadingBuilderState createState() => _FutureLoadingBuilderState(); } -class _FutureLoadingBuilderState extends State> { - Future future; +class _FutureLoadingBuilderState extends State> { + Future? future; @override void initState() { @@ -60,7 +60,7 @@ class _FutureLoadingBuilderState extends State> { @override Widget build(BuildContext context) { - return FutureBuilder( + return FutureBuilder( future: widget.mutable ? widget.future : future, initialData: widget.initialData, builder: (BuildContext context, AsyncSnapshot snapshot) { @@ -96,9 +96,9 @@ class _FutureLoadingBuilderState extends State> { } } - return widget.builder(context, snapshot.data); + return widget.builder!(context, snapshot.data); } - return widget.builder(context, snapshot.data); + return widget.builder!(context, snapshot.data); }, ); } diff --git a/lib/src/utils/location_utils.dart b/lib/src/utils/location_utils.dart index f5209277..1904e9f9 100644 --- a/lib/src/utils/location_utils.dart +++ b/lib/src/utils/location_utils.dart @@ -7,7 +7,7 @@ class LocationUtils { static const _platform = const MethodChannel('google_map_location_picker'); static Map _appHeaderCache = {}; - static Future> getAppHeaders() async { + static Future?> getAppHeaders() async { if (_appHeaderCache.isEmpty) { PackageInfo packageInfo = await PackageInfo.fromPlatform(); @@ -16,7 +16,7 @@ class LocationUtils { "X-Ios-Bundle-Identifier": packageInfo.packageName, }; } else if (Platform.isAndroid) { - String sha1; + String sha1=""; try { sha1 = await _platform.invokeMethod( 'getSigningCertSha1', packageInfo.packageName); diff --git a/pubspec.lock b/pubspec.lock index ae3630e2..a066845c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,58 +5,66 @@ packages: dependency: "direct main" description: name: android_intent - url: "https://pub.dartlang.org" + sha256: "498b451c6be831de2fe032290a8699d2a185c9c6de3bbe6d90db1623a9f62321" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.0.2" async: dependency: transitive description: name: async - url: "https://pub.dartlang.org" + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" source: hosted - version: "2.5.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.1.0" + version: "1.3.0" charcode: dependency: transitive description: name: charcode - url: "https://pub.dartlang.org" + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" clock: dependency: transitive description: name: clock - url: "https://pub.dartlang.org" + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" source: hosted - version: "1.1.0" + 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.15.0" + version: "1.17.1" fake_async: dependency: transitive description: name: fake_async - url: "https://pub.dartlang.org" + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.1" flutter: dependency: "direct main" description: flutter @@ -71,9 +79,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - url: "https://pub.dartlang.org" + sha256: aa36b33c721ac6e889adad07e3c87e6a07b33c28d1f2bc22f2561762cd7d2162 + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.0.2" flutter_test: dependency: "direct dev" description: flutter @@ -88,128 +97,178 @@ 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 + sha256: "2ba24690aee0a3e1b6b7bd47c2711a50c874e95e4c758346589d35194adf6d6a" + url: "https://pub.dev" + source: hosted + version: "4.1.7" + geolocator_apple: + dependency: transitive + description: + name: geolocator_apple + sha256: "22b60ca3b8c0f58e6a9688ff855ee39ab813ca3f0c0609a48d282f6631266f2e" + url: "https://pub.dev" source: hosted - version: "6.2.1" + version: "2.2.5" geolocator_platform_interface: dependency: transitive description: name: geolocator_platform_interface - url: "https://pub.dartlang.org" + sha256: af4d69231452f9620718588f41acc4cb58312368716bfff2e92e770b46ce6386 + url: "https://pub.dev" source: hosted - version: "1.0.9" + 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: "1.0.1" + version: "2.1.6" + geolocator_windows: + dependency: transitive + description: + name: geolocator_windows + sha256: f5911c88e23f48b598dd506c7c19eff0e001645bdc03bb6fecb9f4549208354d + url: "https://pub.dev" + source: hosted + version: "0.1.1" google_maps_flutter: dependency: "direct main" description: name: google_maps_flutter - url: "https://pub.dartlang.org" + sha256: "7cdec2ee1ea553b32dd4dfa66860d65490b64bcd59ca6559ae0f40576618ce23" + url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.0.6" google_maps_flutter_platform_interface: dependency: transitive description: name: google_maps_flutter_platform_interface - url: "https://pub.dartlang.org" + sha256: "971b1bd0fe500343caa940460cf3ec4f796714a9212093e0d4d53de9e33bd87b" + url: "https://pub.dev" source: hosted version: "2.0.0" http: dependency: "direct main" description: name: http - url: "https://pub.dartlang.org" + sha256: b6f1f143a71e1fe1b34670f1acd6f13960ade2557c96b87e127e0cf661969791 + url: "https://pub.dev" source: hosted - version: "0.13.0" + version: "0.13.3" http_parser: dependency: transitive description: name: http_parser - url: "https://pub.dartlang.org" + sha256: e362d639ba3bc07d5a71faebb98cde68c05bfbcfbbb444b60b6f60bb67719185 + url: "https://pub.dev" source: hosted version: "4.0.0" intl: dependency: "direct main" description: name: intl - url: "https://pub.dartlang.org" + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + url: "https://pub.dev" source: hosted - version: "0.17.0" + version: "0.18.0" js: dependency: transitive description: name: js - url: "https://pub.dartlang.org" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" source: hosted - version: "0.6.3" + version: "0.6.7" matcher: dependency: transitive description: name: matcher - url: "https://pub.dartlang.org" + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" source: hosted - version: "0.12.10" + 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.3.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: dependency: "direct main" description: name: package_info - url: "https://pub.dartlang.org" + sha256: "6c07d9d82c69e16afeeeeb6866fe43985a20b3b50df243091bfc4a4ad2b03b75" + url: "https://pub.dev" source: hosted - version: "2.0.0" + version: "2.0.2" path: dependency: transitive description: name: path - url: "https://pub.dartlang.org" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.8.3" pedantic: dependency: transitive description: name: pedantic - url: "https://pub.dartlang.org" + sha256: "8f6460c77a98ad2807cd3b98c67096db4286f56166852d0ce5951bb600a63594" + url: "https://pub.dev" source: hosted version: "1.11.0" platform: dependency: transitive description: name: platform - url: "https://pub.dartlang.org" + sha256: ebc79f16b5f6b609aad4a5e63447d4795d16f7adee46e93ed03200848c006735 + url: "https://pub.dev" source: hosted version: "3.0.0" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - url: "https://pub.dartlang.org" + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "2.1.4" provider: dependency: "direct main" description: name: provider - url: "https://pub.dartlang.org" + sha256: e1e7413d70444ea3096815a60fe5da1b11bda8a9dc4769252cc82c53536f8bcc + url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.4" sky_engine: dependency: transitive description: flutter @@ -219,65 +278,74 @@ packages: dependency: transitive description: name: source_span - url: "https://pub.dartlang.org" + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" stack_trace: dependency: "direct main" 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: ed464977cb26a1f41537e177e190c67223dbd9f4f683489b6ab2e5d211ec564e + url: "https://pub.dev" source: hosted version: "2.0.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.0" + 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.0" + 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.2.19" + version: "0.5.1" typed_data: dependency: transitive description: name: typed_data - url: "https://pub.dartlang.org" + sha256: "53bdf7e979cfbf3e28987552fd72f637e63f3c8724c9e56d9246942dc2fa36ee" + url: "https://pub.dev" source: hosted version: "1.3.0" vector_math: dependency: transitive description: name: vector_math - url: "https://pub.dartlang.org" + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.4" sdks: - dart: ">=2.12.0-259.9.beta <3.0.0" - flutter: ">=2.0.0" + dart: ">=3.0.0-0 <4.0.0" + flutter: ">=2.8.0" diff --git a/pubspec.yaml b/pubspec.yaml index e281a9a7..c66221aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,11 +1,11 @@ name: google_map_location_picker description: '🌍 Map location picker for flutter Based on google_maps_flutter' -version: 4.1.7 +version: 4.1.8 homepage: https://github.com/humazed/google_map_location_picker # flutter pub pub publish --dry-run environment: - sdk: ">=2.2.2 <3.0.0" + sdk: '>=2.12.0 <3.0.0' flutter: ">=2.0.0" dependencies: @@ -14,15 +14,16 @@ dependencies: flutter_localizations: sdk: flutter - intl: ^0.17.0 + intl: ^0.18.0 - google_maps_flutter: ^2.0.1 - geolocator: ^6.1.14 - android_intent: ^2.0.0 - provider: ^5.0.0 - http: ^0.13.0 + google_maps_flutter: ^2.0.6 + geolocator: ^9.0.2 + android_intent: ^2.0.2 + provider: ^6.0.4 + http: ^0.13.3 stack_trace: ^1.10.0 - package_info: ^2.0.0 + package_info: ^2.0.2 + dev_dependencies: flutter_test: