From e73c2de3440e68908c0f6224c4c114227c20a58e Mon Sep 17 00:00:00 2001 From: Balaji G Date: Thu, 24 Oct 2024 19:42:27 +0530 Subject: [PATCH] latest dependancy updated --- android/build.gradle | 44 +++++++++++++++---- example/.flutter-plugins-dependencies | 2 +- example/android/app/build.gradle | 30 ++++++++----- .../android/app/src/debug/AndroidManifest.xml | 2 +- .../android/app/src/main/AndroidManifest.xml | 3 +- .../app/src/profile/AndroidManifest.xml | 2 +- example/android/build.gradle | 17 +------ example/android/gradle.properties | 3 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 30 ++++++++----- example/lib/main.dart | 6 +-- example/pubspec.yaml | 2 +- ios/flutter_sms.podspec | 5 ++- lib/flutter_sms_web.dart | 2 - lib/src/flutter_sms_platform.dart | 9 ++-- 15 files changed, 95 insertions(+), 64 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 6180784..2039b2d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,15 +1,15 @@ -group 'com.example.flutter_sms' -version '1.0-SNAPSHOT' +group = "com.example.flutter_sms" +version = "1.0-SNAPSHOT" buildscript { - ext.kotlin_version = '1.7.10' + ext.kotlin_version = '1.8.22' repositories { google() jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.5.4' + classpath 'com.android.tools.build:gradle:8.1.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -25,20 +25,46 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 31 + if (project.android.hasProperty("namespace")) { + namespace = "com.example.flutter_sms" + } + + compileSdkVersion 34 + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } sourceSets { main.java.srcDirs += 'src/main/kotlin' } defaultConfig { - minSdkVersion 16 + minSdkVersion 21 testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } lintOptions { disable 'InvalidPackage' } -} -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + dependencies { + testImplementation("org.jetbrains.kotlin:kotlin-test") + testImplementation("org.mockito:mockito-core:5.0.0") + } + + testOptions { + unitTests.all { + useJUnitPlatform() + + testLogging { + events "passed", "skipped", "failed", "standardOut", "standardError" + outputs.upToDateWhen {false} + showStandardStreams = true + } + } + } } diff --git a/example/.flutter-plugins-dependencies b/example/.flutter-plugins-dependencies index 1f87844..77b971e 100644 --- a/example/.flutter-plugins-dependencies +++ b/example/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_sms","path":"/Users/dsilk/Development/flutter/packages/flutter_sms/","dependencies":[]},{"name":"url_launcher_ios","path":"/Users/dsilk/.pub-cache/hosted/pub.dartlang.org/url_launcher_ios-6.0.15/","dependencies":[]}],"android":[{"name":"flutter_sms","path":"/Users/dsilk/Development/flutter/packages/flutter_sms/","dependencies":[]},{"name":"url_launcher_android","path":"/Users/dsilk/.pub-cache/hosted/pub.dartlang.org/url_launcher_android-6.0.15/","dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"/Users/dsilk/.pub-cache/hosted/pub.dartlang.org/url_launcher_macos-3.0.0/","dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"/Users/dsilk/.pub-cache/hosted/pub.dartlang.org/url_launcher_linux-3.0.0/","dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"/Users/dsilk/.pub-cache/hosted/pub.dartlang.org/url_launcher_windows-3.0.0/","dependencies":[]}],"web":[{"name":"flutter_sms","path":"/Users/dsilk/Development/flutter/packages/flutter_sms/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/dsilk/.pub-cache/hosted/pub.dartlang.org/url_launcher_web-2.0.8/","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_sms","dependencies":["url_launcher"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2022-02-14 16:50:47.982162","version":"2.10.1"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"flutter_sms","path":"D:\\\\WorkFolder\\\\plugins\\\\flutter_sms\\\\","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"C:\\\\Users\\\\angel\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_ios-6.3.1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"flutter_sms","path":"D:\\\\WorkFolder\\\\plugins\\\\flutter_sms\\\\","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"C:\\\\Users\\\\angel\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_android-6.3.13\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"url_launcher_macos","path":"C:\\\\Users\\\\angel\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_macos-3.2.1\\\\","native_build":true,"dependencies":[]}],"linux":[{"name":"url_launcher_linux","path":"C:\\\\Users\\\\angel\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_linux-3.2.0\\\\","native_build":true,"dependencies":[]}],"windows":[{"name":"url_launcher_windows","path":"C:\\\\Users\\\\angel\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_windows-3.1.3\\\\","native_build":true,"dependencies":[]}],"web":[{"name":"flutter_sms","path":"D:\\\\WorkFolder\\\\plugins\\\\flutter_sms\\\\","dependencies":[]},{"name":"url_launcher_web","path":"C:\\\\Users\\\\angel\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dev\\\\url_launcher_web-2.3.3\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"flutter_sms","dependencies":["url_launcher"]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]}],"date_created":"2024-10-24 19:41:06.208919","version":"3.24.3","swift_package_manager_enabled":false} \ No newline at end of file diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index f95d0d7..3cee837 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,10 @@ +plugins { + id "com.android.application" + id "kotlin-android" + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -21,12 +28,19 @@ 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 { - compileSdkVersion 31 + namespace = "com.example.flutter_sms_example" + compileSdkVersion 34 + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + + kotlinOptions { + jvmTarget = JavaVersion.VERSION_1_8 + } sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -39,7 +53,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.example" - minSdkVersion 16 + minSdkVersion flutter.minSdkVersion targetSdkVersion 31 versionCode flutterVersionCode.toInteger() versionName flutterVersionName @@ -57,7 +71,3 @@ android { flutter { source '../..' } - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml index c208884..d72c32a 100644 --- a/example/android/app/src/debug/AndroidManifest.xml +++ b/example/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.example.flutter_sms_example"> diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml index 6fb01f8..b8885ec 100644 --- a/example/android/app/src/main/AndroidManifest.xml +++ b/example/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/example/android/build.gradle b/example/android/build.gradle index 79f6709..bc157bd 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,20 +1,7 @@ -buildscript { - ext.kotlin_version = '1.6.10' - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:3.5.4' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() - jcenter() + mavenCentral() } } @@ -26,6 +13,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 38c8d45..2597170 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,4 +1,3 @@ -org.gradle.jvmargs=-Xmx1536M -android.enableR8=true +org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true android.enableJetifier=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 493072b..4cf0c84 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 5a2f14f..c3aa23a 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,15 +1,25 @@ -include ':app' +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 flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.2" apply false + id "org.jetbrains.kotlin.android" version "1.8.22" apply false } + +include ":app" \ No newline at end of file diff --git a/example/lib/main.dart b/example/lib/main.dart index d9eb179..2c4e37a 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -73,7 +73,7 @@ class _MyAppState extends State { padding: const EdgeInsets.all(0), child: Text( name, - textScaleFactor: 1, + textScaler: TextScaler.linear(1), style: const TextStyle(fontSize: 12), ), ) @@ -162,9 +162,9 @@ class _MyAppState extends State { padding: const EdgeInsets.all(8), child: ElevatedButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.resolveWith( + backgroundColor: WidgetStateProperty.resolveWith( (states) => Theme.of(context).colorScheme.secondary), - padding: MaterialStateProperty.resolveWith( + padding: WidgetStateProperty.resolveWith( (states) => const EdgeInsets.symmetric(vertical: 16)), ), onPressed: () { diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 0d61367..76af11d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -3,7 +3,7 @@ description: Demonstrates how to use the flutter_sms plugin. publish_to: 'none' environment: - sdk: '>=2.12.0-259.8.beta <3.0.0' + sdk: '>=2.12.0-259.8.beta <=3.5.3' dependencies: flutter: diff --git a/ios/flutter_sms.podspec b/ios/flutter_sms.podspec index 46476f7..8d61707 100644 --- a/ios/flutter_sms.podspec +++ b/ios/flutter_sms.podspec @@ -16,8 +16,9 @@ A new flutter plugin project. s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.platform = :ios, '8.0' + s.platform = :ios, '12.0' # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' end diff --git a/lib/flutter_sms_web.dart b/lib/flutter_sms_web.dart index 6867b38..517e033 100644 --- a/lib/flutter_sms_web.dart +++ b/lib/flutter_sms_web.dart @@ -1,6 +1,4 @@ import 'dart:async'; - -import 'package:flutter/material.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; import 'src/flutter_sms_platform.dart'; diff --git a/lib/src/flutter_sms_platform.dart b/lib/src/flutter_sms_platform.dart index ff4361e..cef5396 100644 --- a/lib/src/flutter_sms_platform.dart +++ b/lib/src/flutter_sms_platform.dart @@ -69,9 +69,10 @@ class FlutterSmsPlatform extends PlatformInterface { String _phones = numbers.join(';'); if (body != null) { final _body = Uri.encodeComponent(body); - return launch('sms:/open?addresses=$_phones${separator}body=$_body'); + return launchUrl( + Uri.parse('sms:/open?addresses=$_phones${separator}body=$_body')); } - return launch('sms:/open?addresses=$_phones'); + return launchUrl(Uri.parse('sms:/open?addresses=$_phones')); } Future launchSms(String? number, [String? body]) { @@ -79,9 +80,9 @@ class FlutterSmsPlatform extends PlatformInterface { number ??= ''; if (body != null) { final _body = Uri.encodeComponent(body); - return launch('sms:/$number${separator}body=$_body'); + return launchUrl(Uri.parse('sms:/$number${separator}body=$_body')); } - return launch('sms:/$number'); + return launchUrl(Uri.parse('sms:/$number')); } String get separator => isCupertino() ? '&' : '?';