From 63ffda88b959887d369a9dbff3b41ab4efe26fac Mon Sep 17 00:00:00 2001 From: Benson Arafat Date: Sun, 27 Oct 2024 05:22:58 +0100 Subject: [PATCH] Update gradle android --- example/android/app/build.gradle | 23 +++++++------- example/android/build.gradle | 12 ------- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 31 ++++++++++++++----- example/lib/main.dart | 12 ++----- 5 files changed, 38 insertions(+), 42 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index dc07198..b49fc3a 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,8 @@ +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()) { @@ -5,12 +10,6 @@ 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' @@ -21,12 +20,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 31 + compileSdkVersion flutter.compileSdkVersion sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -59,5 +58,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 50ed103..79ed1e4 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,15 +1,3 @@ -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 { diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 60c76b3..f29195c 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.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file diff --git a/example/android/settings.gradle b/example/android/settings.gradle index e112e1b..b360496 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +1,26 @@ -include ':app' -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } +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 + }() -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 + 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' \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index 408c42a..d5d752e 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -67,21 +67,18 @@ class _TargetWidgetState extends State { await _controller.showTooltip(); }, child: SuperTooltip( - showBarrier: true, controller: _controller, popupDirection: TooltipDirection.down, backgroundColor: Color(0xff2f2d2f), - // showCloseButton: true, + showCloseButton: true, left: 30, right: 30, - // bottom: 200, + bottom: 200, arrowTipDistance: 20.0, - // minimumOutsideMargin: 120, + minimumOutsideMargin: 120, arrowBaseWidth: 20.0, arrowLength: 20.0, borderWidth: 2.0, - // snapsFarAwayHorizontally: true, - // snapsFarAwayVertically: true, constraints: const BoxConstraints( minHeight: 0.0, maxHeight: 100, @@ -90,9 +87,6 @@ class _TargetWidgetState extends State { ), touchThroughAreaShape: ClipAreaShape.rectangle, touchThroughAreaCornerRadius: 30, - // sigmaY: 10, - // sigmaX: 10, - showDropBoxFilter: true, barrierColor: Color.fromARGB(26, 47, 45, 47), content: const Text( "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.",