From c6f0c6eebfa4357c62e9cdb79c2dc6bff133319c Mon Sep 17 00:00:00 2001 From: Benson Arafat Date: Sat, 26 Oct 2024 18:52:51 +0100 Subject: [PATCH] Update android example version --- example/android/app/build.gradle | 25 ++++++------ example/android/build.gradle | 14 ++++++- .../gradle/wrapper/gradle-wrapper.properties | 4 +- example/android/settings.gradle | 39 ++++--------------- lib/src/super_tooltip.dart | 6 +-- 5 files changed, 37 insertions(+), 51 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 0ca95a4..cc6c9b7 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,8 +1,3 @@ -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()) { @@ -10,6 +5,12 @@ if (localPropertiesFile.exists()) { localProperties.load(reader) } } + +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' @@ -20,12 +21,12 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -// apply plugin: 'com.android.application' -// apply plugin: 'kotlin-android' -// apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion flutter.compileSdkVersion + compileSdkVersion 31 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -38,7 +39,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.super_tooltip_example" - minSdkVersion flutter.minSdkVersion + minSdkVersion 16 targetSdkVersion 28 versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -58,5 +59,5 @@ flutter { } dependencies { - // implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" +} \ No newline at end of file diff --git a/example/android/build.gradle b/example/android/build.gradle index 81fbb1b..50ed103 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,3 +1,15 @@ +buildscript { + ext.kotlin_version = '1.6.10' + repositories { + google() + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:4.1.0' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} allprojects { repositories { @@ -16,4 +28,4 @@ subprojects { tasks.register("clean", Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 609ab8e..60c76b3 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists +zipStorePath=wrapper/dists \ No newline at end of file diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 9df6086..e112e1b 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,36 +1,11 @@ - - -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 - }() - - includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") - - repositories { - google() - mavenCentral() - gradlePluginPortal() - } -} - -plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false -} include ':app' -// def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -// def properties = new Properties() +def localPropertiesFile = new File(rootProject.projectDir, "local.properties") +def properties = new Properties() -// assert localPropertiesFile.exists() -// localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +assert localPropertiesFile.exists() +localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } -// 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" +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" \ No newline at end of file diff --git a/lib/src/super_tooltip.dart b/lib/src/super_tooltip.dart index 37b870c..c24770a 100644 --- a/lib/src/super_tooltip.dart +++ b/lib/src/super_tooltip.dart @@ -195,10 +195,8 @@ class SuperTooltip extends StatefulWidget { /// A custom decoration for the tooltip. /// /// If not provided, the default decoration will be used. - final Decoration? decoration; - final DecorationBuilder? decorationBuilder; - + /// The elevation of the tooltip. /// /// Defaults to `0.0`. @@ -228,7 +226,7 @@ class SuperTooltip extends StatefulWidget { /// /// Defaults to `2.0`. final double arrowTipRadius; - + final double arrowTipDistance; /// The border radius of the tooltip.