Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions geocoding_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)).
Expand Down
13 changes: 1 addition & 12 deletions geocoding_android/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -26,7 +15,7 @@ android {
namespace("com.baseflow.geocoding")
}

compileSdk 33
compileSdk 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
@@ -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
15 changes: 6 additions & 9 deletions geocoding_android/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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()) {
Expand All @@ -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'
Expand All @@ -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
Expand Down
13 changes: 0 additions & 13 deletions geocoding_android/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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
32 changes: 21 additions & 11 deletions geocoding_android/example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -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"
10 changes: 5 additions & 5 deletions geocoding_android/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,21 @@ class BaseflowPluginExample extends StatelessWidget {
static MaterialColor createMaterialColor(Color color) {
final strengths = <double>[.05];
final swatch = <int, Color>{};
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);
}
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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion geocoding_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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

Expand Down