diff --git a/geocoding_android/CHANGELOG.md b/geocoding_android/CHANGELOG.md index b2b3b91..c6c358f 100644 --- a/geocoding_android/CHANGELOG.md +++ b/geocoding_android/CHANGELOG.md @@ -1,3 +1,11 @@ +## 4.0.0 + +* **BREAKING CHANGES** Please update to Flutter 3.29+ before updating to this version +* Updates Android CompileSDK to 35 +* Migrates example project to applying Gradle plugins with the declarative plugins block +* Updates kotlin version to soon minimal supported Kotlin version `1.8.10` +* Updates Gradle version to `8.11.1` + ## 3.3.1 * Removes deprecated support for Android V1 embedding as support will be removed from Flutter (see [flutter/flutter#144726](https://github.com/flutter/flutter/pull/144726)). diff --git a/geocoding_android/android/build.gradle b/geocoding_android/android/build.gradle index f339dda..b097d3e 100644 --- a/geocoding_android/android/build.gradle +++ b/geocoding_android/android/build.gradle @@ -1,17 +1,6 @@ group 'com.baseflow.geocoding' version '1.0' -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - } -} - rootProject.allprojects { repositories { google() @@ -26,7 +15,7 @@ android { namespace("com.baseflow.geocoding") } - compileSdk 33 + compileSdk 35 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 diff --git a/geocoding_android/android/gradle/wrapper/gradle-wrapper.properties b/geocoding_android/android/gradle/wrapper/gradle-wrapper.properties index 529d8df..fdc479b 100644 --- a/geocoding_android/android/gradle/wrapper/gradle-wrapper.properties +++ b/geocoding_android/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Tue Jan 30 14:47:38 CET 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/geocoding_android/example/android/app/build.gradle b/geocoding_android/example/android/app/build.gradle index 744960f..803d022 100644 --- a/geocoding_android/example/android/app/build.gradle +++ b/geocoding_android/example/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { flutterVersionCode = '1' @@ -21,10 +22,6 @@ 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 { namespace "com.baseflow.geocoding_example" compileSdkVersion flutter.compileSdkVersion diff --git a/geocoding_android/example/android/build.gradle b/geocoding_android/example/android/build.gradle index baa7dd2..bc157bd 100644 --- a/geocoding_android/example/android/build.gradle +++ b/geocoding_android/example/android/build.gradle @@ -1,16 +1,3 @@ -buildscript { - ext.kotlin_version = '1.8.0' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() diff --git a/geocoding_android/example/android/gradle/wrapper/gradle-wrapper.properties b/geocoding_android/example/android/gradle/wrapper/gradle-wrapper.properties index 2e15621..7ced2fd 100644 --- a/geocoding_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/geocoding_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Mon Jun 26 13:12:11 AEST 2023 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/geocoding_android/example/android/settings.gradle b/geocoding_android/example/android/settings.gradle index d3b6a40..030789f 100644 --- a/geocoding_android/example/android/settings.gradle +++ b/geocoding_android/example/android/settings.gradle @@ -1,15 +1,25 @@ -// Copyright 2014 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. +pluginManagement { + def flutterSdkPath = { + def properties = new Properties() + file("local.properties").withInputStream { properties.load(it) } + def flutterSdkPath = properties.getProperty("flutter.sdk") + assert flutterSdkPath != null, "flutter.sdk not set in local.properties" + return flutterSdkPath + }() -include ':app' + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" // apply true + id "com.android.application" version "8.10.0" apply false + id "org.jetbrains.kotlin.android" version "1.8.10" apply false +} -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" +include ":app" \ No newline at end of file diff --git a/geocoding_android/example/lib/main.dart b/geocoding_android/example/lib/main.dart index db90df3..d029d94 100644 --- a/geocoding_android/example/lib/main.dart +++ b/geocoding_android/example/lib/main.dart @@ -68,7 +68,7 @@ class BaseflowPluginExample extends StatelessWidget { static MaterialColor createMaterialColor(Color color) { final strengths = [.05]; final swatch = {}; - final r = color.red, g = color.green, b = color.blue; + final r = color.r, g = color.g, b = color.b; for (var i = 1; i < 10; i++) { strengths.add(0.1 * i); @@ -76,13 +76,13 @@ class BaseflowPluginExample extends StatelessWidget { for (var strength in strengths) { final ds = 0.5 - strength; swatch[(strength * 1000).round()] = Color.fromRGBO( - r + ((ds < 0 ? r : (255 - r)) * ds).round(), - g + ((ds < 0 ? g : (255 - g)) * ds).round(), - b + ((ds < 0 ? b : (255 - b)) * ds).round(), + (r + ((ds < 0 ? r : (1.0 - r)) * ds) * 255).round(), + (g + ((ds < 0 ? g : (1.0 - g)) * ds) * 255).round(), + (b + ((ds < 0 ? b : (1.0 - b)) * ds) * 255).round(), 1, ); } - return MaterialColor(color.value, swatch); + return MaterialColor(color.toARGB32(), swatch); } } diff --git a/geocoding_android/pubspec.yaml b/geocoding_android/pubspec.yaml index 7444264..f1d72e5 100644 --- a/geocoding_android/pubspec.yaml +++ b/geocoding_android/pubspec.yaml @@ -1,6 +1,6 @@ name: geocoding_android description: A Flutter Geocoding plugin which provides easy geocoding and reverse-geocoding features. -version: 3.3.1 +version: 4.0.0 repository: https://github.com/baseflow/flutter-geocoding/tree/main/geocoding_android issue_tracker: https://github.com/Baseflow/flutter-geocoding/issues