From cc2abcea09a54dd04712fb3ee08f566307f25c2b Mon Sep 17 00:00:00 2001 From: Matan Shukry Date: Sat, 17 Aug 2024 16:27:20 +0300 Subject: [PATCH 1/3] key from env --- flutter_google_places_sdk/example/lib/constants.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/flutter_google_places_sdk/example/lib/constants.dart b/flutter_google_places_sdk/example/lib/constants.dart index d8c2d50..1e3949f 100644 --- a/flutter_google_places_sdk/example/lib/constants.dart +++ b/flutter_google_places_sdk/example/lib/constants.dart @@ -2,9 +2,9 @@ library constants; import 'package:flutter/material.dart'; -/// note: do NOT store your api key in here or in the code at all. -/// use an external source such as file or firebase remote config -const INITIAL_API_KEY = ''; +/// Define your api in run args, such as +/// --dart-define API_KEY="" +const INITIAL_API_KEY = String.fromEnvironment('API_KEY'); /// Initial value that is used for the locale const INITIAL_LOCALE = Locale('en'); \ No newline at end of file From 80f1c72a0dee222d621a2d3a596d57174b8ad58c Mon Sep 17 00:00:00 2001 From: Matan Shukry Date: Sat, 17 Aug 2024 17:23:25 +0300 Subject: [PATCH 2/3] few fixes before publish --- .../example/android/app/build.gradle | 4 ++- .../example/pubspec.yaml | 4 +++ .../android/build.gradle | 30 ++++++++++--------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/flutter_google_places_sdk/example/android/app/build.gradle b/flutter_google_places_sdk/example/android/app/build.gradle index 709055b..9170ac7 100644 --- a/flutter_google_places_sdk/example/android/app/build.gradle +++ b/flutter_google_places_sdk/example/android/app/build.gradle @@ -26,7 +26,9 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - namespace 'com.msh.flutter_google_places_sdk_example' + if (project.android.hasProperty("namespace")) { + namespace 'com.msh.flutter_google_places_sdk_example' + } compileSdkVersion 34 ndkVersion "26.1.10909125" diff --git a/flutter_google_places_sdk/example/pubspec.yaml b/flutter_google_places_sdk/example/pubspec.yaml index dcb4a0e..099ec5c 100644 --- a/flutter_google_places_sdk/example/pubspec.yaml +++ b/flutter_google_places_sdk/example/pubspec.yaml @@ -12,6 +12,10 @@ dependencies: flutter_google_places_sdk: path: ../../flutter_google_places_sdk +dependency_overrides: + flutter_google_places_sdk_android: + path: ../../flutter_google_places_sdk_android + dev_dependencies: flutter_test: sdk: flutter diff --git a/flutter_google_places_sdk_android/android/build.gradle b/flutter_google_places_sdk_android/android/build.gradle index 6523ff3..967a566 100644 --- a/flutter_google_places_sdk_android/android/build.gradle +++ b/flutter_google_places_sdk_android/android/build.gradle @@ -1,5 +1,5 @@ -group 'com.msh.flutter_google_places_sdk' -version '1.0-SNAPSHOT' +group = "com.msh.flutter_google_places_sdk" +version = "1.0-SNAPSHOT" buildscript { repositories { @@ -8,40 +8,42 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:8.4.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath("com.android.tools.build:gradle:8.4.1") + classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version") } } -rootProject.allprojects { +allprojects { repositories { google() mavenCentral() } } -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' +apply plugin: "com.android.library" +apply plugin: "kotlin-android" android { - namespace 'com.msh.flutter_google_places_sdk_example' + if (project.android.hasProperty("namespace")) { + namespace "com.msh.flutter_google_places_sdk" + } compileSdkVersion 34 compileOptions { - sourceCompatibility JavaVersion.VERSION_17 - targetCompatibility JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { - jvmTarget = '17' + jvmTarget = JavaVersion.VERSION_17 } sourceSets { - main.java.srcDirs += 'src/main/kotlin' - test.java.srcDirs += 'src/test/kotlin' + main.java.srcDirs += "src/main/kotlin" + test.java.srcDirs += "src/test/kotlin" } defaultConfig { - minSdkVersion 21 + minSdk = 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { From ab7e4a33402e8994431a26b236e13bb59f6d1f86 Mon Sep 17 00:00:00 2001 From: Matan Shukry Date: Sat, 17 Aug 2024 17:25:32 +0300 Subject: [PATCH 3/3] Android 0.1.9: * Upgrading gradle kotlin and java versions to be compatible with Java 17 --- flutter_google_places_sdk_android/CHANGELOG.md | 4 ++++ flutter_google_places_sdk_android/pubspec.yaml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/flutter_google_places_sdk_android/CHANGELOG.md b/flutter_google_places_sdk_android/CHANGELOG.md index 6318d4a..1186755 100644 --- a/flutter_google_places_sdk_android/CHANGELOG.md +++ b/flutter_google_places_sdk_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.9 + +* Upgrading gradle kotlin and java versions to be compatible with Java 17 + ## 0.1.8 * Upgrading `flutter_google_places_sdk_platform_interface` to `0.2.7` diff --git a/flutter_google_places_sdk_android/pubspec.yaml b/flutter_google_places_sdk_android/pubspec.yaml index bbb198a..122472d 100644 --- a/flutter_google_places_sdk_android/pubspec.yaml +++ b/flutter_google_places_sdk_android/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_google_places_sdk_android description: A Flutter plugin for google places sdk that uses the native libraries on each platform -version: 0.1.8 +version: 0.1.9 homepage: https://github.com/matanshukry/flutter_google_places_sdk/tree/master/flutter_google_places_sdk_android environment: @@ -15,7 +15,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: ^5.3.2 + mockito: ^5.4.4 flutter: plugin: