diff --git a/.gitignore b/.gitignore index e96dabcc..c554b15e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,10 @@ unlinked_spec.ds .fvmrc .cxx/ +# Swift Package Manager +.build/ +.swiftpm/ + # Coverage coverage/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 11aca603..efee9828 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,39 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2026-07-13 + +### Changes + +--- + +Packages with breaking changes: + + - There are no breaking changes in this release. + +Packages with other changes: + + - [`wifi_iot` - `v0.3.19+3`](#wifi_iot---v03193) + - [`wifi_scan` - `v0.4.1+3`](#wifi_scan---v0413) + +--- + +#### `wifi_iot` - `v0.3.19+3` + + - **CHORE**: Flutter 3.44 / Dart 3.12 SDK constraints. + - **FEAT**: Add Swift Package Manager support (CocoaPods retained). + - **CHORE**: Migrate Android Gradle scripts from Groovy to Kotlin DSL; bump AGP, Gradle, and Java toolchain. + - **CHORE**: Update dependencies. + +#### `wifi_scan` - `v0.4.1+3` + + - **CHORE**: Flutter 3.44 / Dart 3.12 SDK constraints. + - **FEAT**: Add Swift Package Manager support (CocoaPods retained). + - **CHORE**: Migrate Android Gradle scripts from Groovy to Kotlin DSL; bump AGP, Gradle, and Java toolchain. + - **CHORE**: Migrate to built-in Kotlin. + - **CHORE**: Update dependencies. + + ## 2025-02-18 ### Changes diff --git a/packages/wifi_iot/CHANGELOG.md b/packages/wifi_iot/CHANGELOG.md index 0ec3468f..2c000b61 100644 --- a/packages/wifi_iot/CHANGELOG.md +++ b/packages/wifi_iot/CHANGELOG.md @@ -1,3 +1,10 @@ +## 0.3.19+3 + + - **CHORE**: Flutter 3.44 / Dart 3.12 SDK constraints. + - **FEAT**: Add Swift Package Manager support (CocoaPods retained). + - **CHORE**: Migrate Android Gradle scripts from Groovy to Kotlin DSL; bump AGP, Gradle, and Java toolchain. + - **CHORE**: Update dependencies. + ## 0.3.19+2 - **FIX**(wifi_iot): iOS isConnected always true even connection is failed - synced with master (#407). diff --git a/packages/wifi_iot/android/build.gradle b/packages/wifi_iot/android/build.gradle deleted file mode 100644 index c4d62eb2..00000000 --- a/packages/wifi_iot/android/build.gradle +++ /dev/null @@ -1,36 +0,0 @@ -group 'com.alternadom.wifiiot' -version '1.0-SNAPSHOT' - -buildscript { - repositories { - google() - jcenter() - } - - dependencies { - classpath 'com.android.tools.build:gradle:8.2.0' - } -} - -rootProject.allprojects { - repositories { - google() - jcenter() - } -} - -apply plugin: 'com.android.library' - -android { - namespace 'com.alternadom.wifiiot' - - compileSdkVersion 34 - - defaultConfig { - minSdkVersion 16 - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - lintOptions { - disable 'InvalidPackage' - } -} diff --git a/packages/wifi_iot/android/build.gradle.kts b/packages/wifi_iot/android/build.gradle.kts new file mode 100644 index 00000000..2753a52e --- /dev/null +++ b/packages/wifi_iot/android/build.gradle.kts @@ -0,0 +1,43 @@ +group = "com.alternadom.wifiiot" +version = "1.0" + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath("com.android.tools.build:gradle:9.0.1") + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +plugins { + id("com.android.library") +} + +android { + namespace = "com.alternadom.wifiiot" + + compileSdk = 36 + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + minSdk = 16 + } + + lint { + disable += "InvalidPackage" + } +} diff --git a/packages/wifi_iot/android/gradle.properties b/packages/wifi_iot/android/gradle.properties index 876bcc0e..94adc3a3 100644 --- a/packages/wifi_iot/android/gradle.properties +++ b/packages/wifi_iot/android/gradle.properties @@ -1,5 +1,3 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -android.enableR8=true -android.enableR8.fullMode=false diff --git a/packages/wifi_iot/android/settings.gradle b/packages/wifi_iot/android/settings.gradle deleted file mode 100644 index 4ae80feb..00000000 --- a/packages/wifi_iot/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'wifi_iot' diff --git a/packages/wifi_iot/android/settings.gradle.kts b/packages/wifi_iot/android/settings.gradle.kts new file mode 100644 index 00000000..6977d66d --- /dev/null +++ b/packages/wifi_iot/android/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "wifi_iot" diff --git a/packages/wifi_iot/example/android/app/build.gradle b/packages/wifi_iot/example/android/app/build.gradle deleted file mode 100644 index 00249e52..00000000 --- a/packages/wifi_iot/example/android/app/build.gradle +++ /dev/null @@ -1,74 +0,0 @@ -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()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -android { - namespace 'com.alternadom.wifiiotexample' - compileSdk flutter.compileSdkVersion - ndkVersion flutter.ndkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.alternadom.wifiiotexample" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - - - -dependencies { - testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test.ext:junit:1.1.1' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' -} - - diff --git a/packages/wifi_iot/example/android/app/build.gradle.kts b/packages/wifi_iot/example/android/app/build.gradle.kts new file mode 100644 index 00000000..434853fb --- /dev/null +++ b/packages/wifi_iot/example/android/app/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + id("com.android.application") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "com.alternadom.wifiiotexample" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + applicationId = "com.alternadom.wifiiotexample" + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/packages/wifi_iot/example/android/build.gradle b/packages/wifi_iot/example/android/build.gradle deleted file mode 100644 index 42dc81d9..00000000 --- a/packages/wifi_iot/example/android/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - jcenter() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" -} -subprojects { - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} \ No newline at end of file diff --git a/packages/wifi_iot/example/android/build.gradle.kts b/packages/wifi_iot/example/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/packages/wifi_iot/example/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/packages/wifi_iot/example/android/gradle.properties b/packages/wifi_iot/example/android/gradle.properties index 25ac3744..e96108cf 100644 --- a/packages/wifi_iot/example/android/gradle.properties +++ b/packages/wifi_iot/example/android/gradle.properties @@ -1,5 +1,6 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true -android.enableR8=true -android.enableR8.fullMode=false \ No newline at end of file +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/packages/wifi_iot/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/wifi_iot/example/android/gradle/wrapper/gradle-wrapper.properties index 3acc4a6f..5237affd 100644 --- a/packages/wifi_iot/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/wifi_iot/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip \ No newline at end of file +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip \ No newline at end of file diff --git a/packages/wifi_iot/example/android/settings.gradle b/packages/wifi_iot/example/android/settings.gradle deleted file mode 100644 index f2c26252..00000000 --- a/packages/wifi_iot/example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -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 "8.2.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.10" apply false -} - -include ":app" \ No newline at end of file diff --git a/packages/wifi_iot/example/android/settings.gradle.kts b/packages/wifi_iot/example/android/settings.gradle.kts new file mode 100644 index 00000000..c21f0c5b --- /dev/null +++ b/packages/wifi_iot/example/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + 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 "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false +} + +include(":app") diff --git a/packages/wifi_iot/example/android/settings_aar.gradle b/packages/wifi_iot/example/android/settings_aar.gradle deleted file mode 100644 index e7b4def4..00000000 --- a/packages/wifi_iot/example/android/settings_aar.gradle +++ /dev/null @@ -1 +0,0 @@ -include ':app' diff --git a/packages/wifi_iot/example/ios/.gitignore b/packages/wifi_iot/example/ios/.gitignore index 79cc4da8..4dab8bdd 100644 --- a/packages/wifi_iot/example/ios/.gitignore +++ b/packages/wifi_iot/example/ios/.gitignore @@ -39,6 +39,8 @@ Icon? /Flutter/App.framework /Flutter/Flutter.framework /Flutter/Generated.xcconfig +/Flutter/ephemeral/ +/Flutter/flutter_export_environment.sh /ServiceDefinitions.json Pods/ diff --git a/packages/wifi_iot/example/ios/Flutter/AppFrameworkInfo.plist b/packages/wifi_iot/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f9..391a902b 100644 --- a/packages/wifi_iot/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/wifi_iot/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 9.0 diff --git a/packages/wifi_iot/example/ios/Podfile b/packages/wifi_iot/example/ios/Podfile index 1e8c3c90..e72e0b48 100644 --- a/packages/wifi_iot/example/ios/Podfile +++ b/packages/wifi_iot/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/packages/wifi_iot/example/ios/Runner.xcodeproj/project.pbxproj b/packages/wifi_iot/example/ios/Runner.xcodeproj/project.pbxproj index 3949901f..b292f06b 100644 --- a/packages/wifi_iot/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/wifi_iot/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 17E7A1E020C98264008E10CD /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 17E7A1DF20C98264008E10CD /* NetworkExtension.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 9740EEB51CF90195004384FC /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -44,6 +45,9 @@ 3B4AEEECCF2871CD8E0FE17E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 784666492D4C4C64000A1A5F /* FlutterFramework */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterFramework; path = Flutter/ephemeral/Packages/.packages/FlutterFramework; sourceTree = ""; }; + 78DABEA22ED26510000E7860 /* wifi_iot */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = wifi_iot; path = ../../ios/wifi_iot; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; @@ -60,6 +64,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 17E7A1DE20C98260008E10CD /* ExternalAccessory.framework in Frameworks */, 17E7A1E020C98264008E10CD /* NetworkExtension.framework in Frameworks */, 176B4CC4D709866371F34648 /* Pods_Runner.framework in Frameworks */, @@ -91,6 +96,9 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78DABEA22ED26510000E7860 /* wifi_iot */, + 784666492D4C4C64000A1A5F /* FlutterFramework */, + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -156,13 +164,15 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 7BB0D1ACFC8A0AF1B10F1DCC /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -173,7 +183,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0910; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -203,6 +213,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -231,10 +244,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -243,26 +258,9 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 7BB0D1ACFC8A0AF1B10F1DCC /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/wifi_iot/wifi_iot.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/wifi_iot.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -372,7 +370,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -419,7 +417,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; @@ -443,7 +441,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -473,7 +474,10 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -509,6 +513,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/packages/wifi_iot/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/wifi_iot/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 1263ac84..de94d244 100644 --- a/packages/wifi_iot/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/wifi_iot/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + diff --git a/packages/wifi_iot/example/ios/Runner/AppDelegate.swift b/packages/wifi_iot/example/ios/Runner/AppDelegate.swift index 71cc41e3..f1dc4867 100644 --- a/packages/wifi_iot/example/ios/Runner/AppDelegate.swift +++ b/packages/wifi_iot/example/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@UIApplicationMain +@main @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/packages/wifi_iot/example/ios/Runner/Info.plist b/packages/wifi_iot/example/ios/Runner/Info.plist index db61027a..d7299d96 100644 --- a/packages/wifi_iot/example/ios/Runner/Info.plist +++ b/packages/wifi_iot/example/ios/Runner/Info.plist @@ -41,5 +41,9 @@ UIViewControllerBasedStatusBarAppearance + CADisableMinimumFrameDurationOnPhone + + UIApplicationSupportsIndirectInputEvents + diff --git a/packages/wifi_iot/example/lib/main.dart b/packages/wifi_iot/example/lib/main.dart index 5818deb7..5d83f249 100755 --- a/packages/wifi_iot/example/lib/main.dart +++ b/packages/wifi_iot/example/lib/main.dart @@ -1,4 +1,4 @@ -// ignore_for_file: deprecated_member_use, package_api_docs, public_member_api_docs +// ignore_for_file: deprecated_member_use, package_api_docs, public_member_api_docs, constant_identifier_names, avoid_print, avoid_function_literals_in_foreach_calls import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:wifi_iot/wifi_iot.dart'; @@ -14,8 +14,10 @@ const String AP_DEFAULT_PASSWORD = "AP_PASSWORD"; void main() => runApp(FlutterWifiIoT()); class FlutterWifiIoT extends StatefulWidget { + const FlutterWifiIoT({super.key}); + @override - _FlutterWifiIoTState createState() => _FlutterWifiIoTState(); + State createState() => _FlutterWifiIoTState(); } class _FlutterWifiIoTState extends State { @@ -23,7 +25,7 @@ class _FlutterWifiIoTState extends State { String? _sPreviousPreSharedKey = ""; List? _htResultNetwork; - Map? _htIsNetworkRegistered = Map(); + final Map _htIsNetworkRegistered = {}; bool _isEnabled = false; bool _isConnected = false; @@ -54,13 +56,13 @@ class _FlutterWifiIoTState extends State { super.initState(); } - storeAndConnect(String psSSID, String psKey) async { + Future storeAndConnect(String psSSID, String psKey) async { await storeAPInfos(); await WiFiForIoTPlugin.setWiFiAPSSID(psSSID); await WiFiForIoTPlugin.setWiFiAPPreSharedKey(psKey); } - storeAPInfos() async { + Future storeAPInfos() async { String? sAPSSID; String? sPreSharedKey; @@ -82,7 +84,7 @@ class _FlutterWifiIoTState extends State { }); } - restoreAPInfos() async { + Future restoreAPInfos() async { WiFiForIoTPlugin.setWiFiAPSSID(_sPreviousAPSSID!); WiFiForIoTPlugin.setWiFiAPPreSharedKey(_sPreviousPreSharedKey!); } @@ -158,7 +160,7 @@ class _FlutterWifiIoTState extends State { return htResultNetwork; } - isRegisteredWifiNetwork(String ssid) async { + Future isRegisteredWifiNetwork(String ssid) async { bool bIsRegistered; try { @@ -168,7 +170,7 @@ class _FlutterWifiIoTState extends State { } setState(() { - _htIsNetworkRegistered![ssid] = bIsRegistered; + _htIsNetworkRegistered[ssid] = bIsRegistered; }); } @@ -197,10 +199,10 @@ class _FlutterWifiIoTState extends State { _htResultNetwork = null; } - if (_htResultNetwork != null && _htResultNetwork!.length > 0) { + if (_htResultNetwork != null && _htResultNetwork!.isNotEmpty) { final List htNetworks = []; - _htResultNetwork!.forEach((oNetwork) { + for (var oNetwork in _htResultNetwork!) { final PopupCommand oCmdConnect = PopupCommand("Connect", oNetwork!.ssid!); final PopupCommand oCmdRemove = PopupCommand("Remove", oNetwork.ssid!); @@ -216,8 +218,8 @@ class _FlutterWifiIoTState extends State { setState(() { isRegisteredWifiNetwork(oNetwork.ssid!); - if (_htIsNetworkRegistered!.containsKey(oNetwork.ssid) && - _htIsNetworkRegistered![oNetwork.ssid]!) { + if (_htIsNetworkRegistered.containsKey(oNetwork.ssid) && + _htIsNetworkRegistered[oNetwork.ssid]!) { htPopupMenuItems.add( PopupMenuItem( value: oCmdRemove, @@ -228,12 +230,10 @@ class _FlutterWifiIoTState extends State { htNetworks.add( ListTile( - title: Text("" + - oNetwork.ssid! + - ((_htIsNetworkRegistered!.containsKey(oNetwork.ssid) && - _htIsNetworkRegistered![oNetwork.ssid]!) + title: Text("${oNetwork.ssid!}${(_htIsNetworkRegistered.containsKey(oNetwork.ssid) && + _htIsNetworkRegistered[oNetwork.ssid]!) ? " *" - : "")), + : ""}"), trailing: PopupMenuButton( padding: EdgeInsets.zero, onSelected: (PopupCommand poCommand) { @@ -256,7 +256,7 @@ class _FlutterWifiIoTState extends State { ), ); }); - }); + } return ListView( padding: kMaterialListPadding, @@ -505,7 +505,7 @@ class _FlutterWifiIoTState extends State { WiFiForIoTPlugin.setWiFiAPSSIDHidden(false); }, ) - : Container(width: 0, height: 0); + : SizedBox(width: 0, height: 0); } else { htPrimaryWidgets.add(Text("SSID is visible")); !_isWiFiAPEnabled @@ -516,7 +516,7 @@ class _FlutterWifiIoTState extends State { WiFiForIoTPlugin.setWiFiAPSSIDHidden(true); }, ) - : Container(width: 0, height: 0); + : SizedBox(width: 0, height: 0); } FutureBuilder( @@ -576,7 +576,7 @@ class _FlutterWifiIoTState extends State { _isConnected = val; })); - String? _sSSID; + String? sSSID; if (_isConnected) { htPrimaryWidgets.addAll([ @@ -585,13 +585,13 @@ class _FlutterWifiIoTState extends State { future: WiFiForIoTPlugin.getSSID(), initialData: "Loading..", builder: (BuildContext context, AsyncSnapshot ssid) { - _sSSID = ssid.data; + sSSID = ssid.data; return Text("SSID: ${ssid.data}"); }), ]); - if (_sSSID == STA_DEFAULT_SSID) { + if (sSSID == STA_DEFAULT_SSID) { htPrimaryWidgets.addAll([ MaterialButton( color: Colors.blue, diff --git a/packages/wifi_iot/example/pubspec.yaml b/packages/wifi_iot/example/pubspec.yaml index 20d81b54..622ac2f0 100644 --- a/packages/wifi_iot/example/pubspec.yaml +++ b/packages/wifi_iot/example/pubspec.yaml @@ -4,7 +4,7 @@ version: 0.1.0+1 publish_to: none environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ^3.12.0 dependencies: flutter: @@ -15,11 +15,12 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.6 + cupertino_icons: ^1.0.8 dev_dependencies: flutter_test: sdk: flutter + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the # following page: https://www.dartlang.org/tools/pub/pubspec diff --git a/packages/wifi_iot/ios/Assets/.gitkeep b/packages/wifi_iot/ios/Assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/wifi_iot/ios/Classes/WifiIotPlugin.h b/packages/wifi_iot/ios/Classes/WifiIotPlugin.h deleted file mode 100644 index 3ed21275..00000000 --- a/packages/wifi_iot/ios/Classes/WifiIotPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface WifiIotPlugin : NSObject -@end diff --git a/packages/wifi_iot/ios/Classes/WifiIotPlugin.m b/packages/wifi_iot/ios/Classes/WifiIotPlugin.m deleted file mode 100644 index b75f236f..00000000 --- a/packages/wifi_iot/ios/Classes/WifiIotPlugin.m +++ /dev/null @@ -1,8 +0,0 @@ -#import "WifiIotPlugin.h" -#import - -@implementation WifiIotPlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - [SwiftWifiIotPlugin registerWithRegistrar:registrar]; -} -@end diff --git a/packages/wifi_iot/ios/wifi_iot.podspec b/packages/wifi_iot/ios/wifi_iot.podspec index df11c99a..2689478f 100644 --- a/packages/wifi_iot/ios/wifi_iot.podspec +++ b/packages/wifi_iot/ios/wifi_iot.podspec @@ -4,19 +4,19 @@ Pod::Spec.new do |s| s.name = 'wifi_iot' s.version = '0.0.1' - s.summary = 'A new flutter plugin project.' + s.summary = 'Flutter plugin which can handle WiFi connections and hotspot (AP, STA).' s.description = <<-DESC -A new flutter plugin project. +Flutter plugin which can handle WiFi connections and hotspot (AP, STA). DESC - s.homepage = 'http://example.com' + s.homepage = 'https://github.com/flutternetwork/WiFiFlutter' s.license = { :file => '../LICENSE' } - s.author = { 'Your Company' => 'email@example.com' } + s.author = { 'WiFiFlutter' => 'contact@flutternetwork.dev' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' + s.source_files = 'wifi_iot/Sources/wifi_iot/**/*.swift' s.dependency 'Flutter' - - s.ios.deployment_target = '8.0' - s.swift_version = '4.0' -end + s.platform = :ios, '13.0' + # Flutter.framework does not contain a i386 slice. + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } + s.swift_version = '5.0' +end diff --git a/packages/wifi_iot/ios/wifi_iot/Package.swift b/packages/wifi_iot/ios/wifi_iot/Package.swift new file mode 100644 index 00000000..1b18d1ad --- /dev/null +++ b/packages/wifi_iot/ios/wifi_iot/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "wifi_iot", + platforms: [ + .iOS("13.0") + ], + products: [ + .library(name: "wifi-iot", targets: ["wifi_iot"]) + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework") + ], + targets: [ + .target( + name: "wifi_iot", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework") + ], + resources: [ + // If your plugin requires a privacy manifest, for example if it uses any required + // reason APIs, update the PrivacyInfo.xcprivacy file to describe your plugin's + // privacy impact, and then uncomment these lines. For more information, see + // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files + // .process("PrivacyInfo.xcprivacy"), + + // If you have other resources that need to be bundled with your plugin, refer to + // the following instructions to add them: + // https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package + ] + ) + ] +) diff --git a/packages/wifi_iot/ios/Classes/SwiftWifiIotPlugin.swift b/packages/wifi_iot/ios/wifi_iot/Sources/wifi_iot/WifiIotPlugin.swift similarity index 99% rename from packages/wifi_iot/ios/Classes/SwiftWifiIotPlugin.swift rename to packages/wifi_iot/ios/wifi_iot/Sources/wifi_iot/WifiIotPlugin.swift index 5638700a..263800c1 100755 --- a/packages/wifi_iot/ios/Classes/SwiftWifiIotPlugin.swift +++ b/packages/wifi_iot/ios/wifi_iot/Sources/wifi_iot/WifiIotPlugin.swift @@ -3,10 +3,10 @@ import UIKit import SystemConfiguration.CaptiveNetwork import NetworkExtension -public class SwiftWifiIotPlugin: NSObject, FlutterPlugin { +public class WifiIotPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { let channel = FlutterMethodChannel(name: "wifi_iot", binaryMessenger: registrar.messenger()) - let instance = SwiftWifiIotPlugin() + let instance = WifiIotPlugin() registrar.addMethodCallDelegate(instance, channel: channel) } diff --git a/packages/wifi_iot/pubspec.yaml b/packages/wifi_iot/pubspec.yaml index d20135ec..4b6e69b8 100644 --- a/packages/wifi_iot/pubspec.yaml +++ b/packages/wifi_iot/pubspec.yaml @@ -1,6 +1,6 @@ name: wifi_iot description: Flutter plugin which can handle WiFi connections and hotspot (AP, STA) -version: 0.3.19+2 +version: 0.3.19+3 homepage: https://github.com/flutternetwork/WiFiFlutter/tree/master/packages/wifi_iot flutter: @@ -14,9 +14,8 @@ flutter: pluginClass: WifiIotPlugin environment: - sdk: '>=2.12.0 <3.0.0' - # Flutter versions prior to 1.10 did not support the flutter.plugin.platforms map. - flutter: ">=1.10.0" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: diff --git a/packages/wifi_scan/CHANGELOG.md b/packages/wifi_scan/CHANGELOG.md index b23f7945..f4ac2f9e 100644 --- a/packages/wifi_scan/CHANGELOG.md +++ b/packages/wifi_scan/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.4.1+3 + + - **CHORE**: Flutter 3.44 / Dart 3.12 SDK constraints. + - **FEAT**: Add Swift Package Manager support (CocoaPods retained). + - **CHORE**: Migrate Android Gradle scripts from Groovy to Kotlin DSL; bump AGP, Gradle, and Java toolchain. + - **CHORE**: Migrate to built-in Kotlin. + - **CHORE**: Update dependencies. + ## 0.4.1+2 - **FIX**: Update compileSdkVersion to fix Android release build with flutter 3.24 (#398). diff --git a/packages/wifi_scan/android/build.gradle b/packages/wifi_scan/android/build.gradle deleted file mode 100644 index 24ba46ad..00000000 --- a/packages/wifi_scan/android/build.gradle +++ /dev/null @@ -1,52 +0,0 @@ -group 'dev.flutternetwork.wifi.wifi_scan' -version '1.0-SNAPSHOT' - -buildscript { - ext.kotlin_version = '1.8.21' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:8.2.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -rootProject.allprojects { - repositories { - google() - mavenCentral() - } -} - -apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' - -android { - namespace 'dev.flutternetwork.wifi.wifi_scan' - - compileSdkVersion 34 - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - minSdkVersion 16 - } -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/packages/wifi_scan/android/build.gradle.kts b/packages/wifi_scan/android/build.gradle.kts new file mode 100644 index 00000000..87125adc --- /dev/null +++ b/packages/wifi_scan/android/build.gradle.kts @@ -0,0 +1,51 @@ +group = "dev.flutternetwork.wifi.wifi_scan" +version = "1.0-SNAPSHOT" + +buildscript { + repositories { + google() + mavenCentral() + } + + dependencies { + classpath("com.android.tools.build:gradle:9.0.1") + } +} + +allprojects { + repositories { + google() + mavenCentral() + } +} + +plugins { + id("com.android.library") +} + +android { + namespace = "dev.flutternetwork.wifi.wifi_scan" + + compileSdk = 36 + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + sourceSets { + getByName("main") { + java.srcDirs("src/main/kotlin") + } + } + + defaultConfig { + minSdk = 16 + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} diff --git a/packages/wifi_scan/android/gradle.properties b/packages/wifi_scan/android/gradle.properties index 876bcc0e..94adc3a3 100644 --- a/packages/wifi_scan/android/gradle.properties +++ b/packages/wifi_scan/android/gradle.properties @@ -1,5 +1,3 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true -android.enableR8=true -android.enableR8.fullMode=false diff --git a/packages/wifi_scan/android/gradle/wrapper/gradle-wrapper.properties b/packages/wifi_scan/android/gradle/wrapper/gradle-wrapper.properties index b5fc5a7b..2d428bfb 100644 --- a/packages/wifi_scan/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/wifi_scan/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/packages/wifi_scan/android/settings.gradle b/packages/wifi_scan/android/settings.gradle deleted file mode 100644 index a528fecb..00000000 --- a/packages/wifi_scan/android/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = 'wifi_scan' diff --git a/packages/wifi_scan/android/settings.gradle.kts b/packages/wifi_scan/android/settings.gradle.kts new file mode 100644 index 00000000..578988da --- /dev/null +++ b/packages/wifi_scan/android/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "wifi_scan" diff --git a/packages/wifi_scan/example/android/app/build.gradle b/packages/wifi_scan/example/android/app/build.gradle deleted file mode 100644 index 042d84f1..00000000 --- a/packages/wifi_scan/example/android/app/build.gradle +++ /dev/null @@ -1,66 +0,0 @@ -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()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -android { - namespace 'dev.flutternetwork.wifi.wifi_scan_example' - - compileSdkVersion flutter.compileSdkVersion - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "dev.flutternetwork.wifi.wifi_scan_example" - minSdkVersion flutter.minSdkVersion - targetSdkVersion flutter.targetSdkVersion - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { -} diff --git a/packages/wifi_scan/example/android/app/build.gradle.kts b/packages/wifi_scan/example/android/app/build.gradle.kts new file mode 100644 index 00000000..7c67b7b1 --- /dev/null +++ b/packages/wifi_scan/example/android/app/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + id("com.android.application") + // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. + id("dev.flutter.flutter-gradle-plugin") +} + +android { + namespace = "dev.flutternetwork.wifi.wifi_scan_example" + compileSdk = flutter.compileSdkVersion + ndkVersion = flutter.ndkVersion + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + defaultConfig { + applicationId = "dev.flutternetwork.wifi.wifi_scan_example" + minSdk = flutter.minSdkVersion + targetSdk = flutter.targetSdkVersion + versionCode = flutter.versionCode + versionName = flutter.versionName + } + + buildTypes { + release { + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig = signingConfigs.getByName("debug") + } + } +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 + } +} + +flutter { + source = "../.." +} diff --git a/packages/wifi_scan/example/android/build.gradle b/packages/wifi_scan/example/android/build.gradle deleted file mode 100644 index b42eb3a7..00000000 --- a/packages/wifi_scan/example/android/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" - project.evaluationDependsOn(':app') -} - -tasks.register("clean", Delete) { - delete rootProject.buildDir -} diff --git a/packages/wifi_scan/example/android/build.gradle.kts b/packages/wifi_scan/example/android/build.gradle.kts new file mode 100644 index 00000000..dbee657b --- /dev/null +++ b/packages/wifi_scan/example/android/build.gradle.kts @@ -0,0 +1,24 @@ +allprojects { + repositories { + google() + mavenCentral() + } +} + +val newBuildDir: Directory = + rootProject.layout.buildDirectory + .dir("../../build") + .get() +rootProject.layout.buildDirectory.value(newBuildDir) + +subprojects { + val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) + project.layout.buildDirectory.value(newSubprojectBuildDir) +} +subprojects { + project.evaluationDependsOn(":app") +} + +tasks.register("clean") { + delete(rootProject.layout.buildDirectory) +} diff --git a/packages/wifi_scan/example/android/gradle.properties b/packages/wifi_scan/example/android/gradle.properties index 25ac3744..e96108cf 100644 --- a/packages/wifi_scan/example/android/gradle.properties +++ b/packages/wifi_scan/example/android/gradle.properties @@ -1,5 +1,6 @@ -org.gradle.jvmargs=-Xmx1536M +org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError android.useAndroidX=true -android.enableJetifier=true -android.enableR8=true -android.enableR8.fullMode=false \ No newline at end of file +# This newDsl flag was added by the Flutter template +android.newDsl=false +# This builtInKotlin flag was added by the Flutter template +android.builtInKotlin=false diff --git a/packages/wifi_scan/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/wifi_scan/example/android/gradle/wrapper/gradle-wrapper.properties index d07c7fcf..a97e89ca 100644 --- a/packages/wifi_scan/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/wifi_scan/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-8.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-all.zip diff --git a/packages/wifi_scan/example/android/settings.gradle b/packages/wifi_scan/example/android/settings.gradle deleted file mode 100644 index 5b99b39c..00000000 --- a/packages/wifi_scan/example/android/settings.gradle +++ /dev/null @@ -1,25 +0,0 @@ -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 "8.2.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.21" apply false -} - -include ":app" \ No newline at end of file diff --git a/packages/wifi_scan/example/android/settings.gradle.kts b/packages/wifi_scan/example/android/settings.gradle.kts new file mode 100644 index 00000000..c21f0c5b --- /dev/null +++ b/packages/wifi_scan/example/android/settings.gradle.kts @@ -0,0 +1,26 @@ +pluginManagement { + val flutterSdkPath = + run { + val properties = java.util.Properties() + file("local.properties").inputStream().use { properties.load(it) } + val flutterSdkPath = properties.getProperty("flutter.sdk") + require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } + 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 "9.0.1" apply false + id("org.jetbrains.kotlin.android") version "2.3.20" apply false +} + +include(":app") diff --git a/packages/wifi_scan/example/ios/Flutter/AppFrameworkInfo.plist b/packages/wifi_scan/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f9..391a902b 100644 --- a/packages/wifi_scan/example/ios/Flutter/AppFrameworkInfo.plist +++ b/packages/wifi_scan/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 9.0 diff --git a/packages/wifi_scan/example/ios/Podfile b/packages/wifi_scan/example/ios/Podfile index 1e8c3c90..e72e0b48 100644 --- a/packages/wifi_scan/example/ios/Podfile +++ b/packages/wifi_scan/example/ios/Podfile @@ -1,5 +1,5 @@ # Uncomment this line to define a global platform for your project -# platform :ios, '9.0' +# platform :ios, '13.0' # CocoaPods analytics sends network stats synchronously affecting flutter build latency. ENV['COCOAPODS_DISABLE_STATS'] = 'true' diff --git a/packages/wifi_scan/example/ios/Runner.xcodeproj/project.pbxproj b/packages/wifi_scan/example/ios/Runner.xcodeproj/project.pbxproj index 1a83e33e..34e0ddd6 100644 --- a/packages/wifi_scan/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/wifi_scan/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,13 +3,14 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; @@ -36,6 +37,9 @@ 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 784666492D4C4C64000A1A5F /* FlutterFramework */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterFramework; path = Flutter/ephemeral/Packages/.packages/FlutterFramework; sourceTree = ""; }; + 78DABEA22ED26510000E7860 /* wifi_scan */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = wifi_scan; path = ../../ios/wifi_scan; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 82A6DCFC7EA9D7C1336EF2EA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; @@ -54,6 +58,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ED879899797BD40D00C7B393 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -83,6 +88,9 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78DABEA22ED26510000E7860 /* wifi_scan */, + 784666492D4C4C64000A1A5F /* FlutterFramework */, + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -139,13 +147,15 @@ 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 9119DAADF478773DD2355190 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = Runner; + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; @@ -156,7 +166,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -174,6 +184,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -200,10 +213,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -212,25 +227,9 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; - 9119DAADF478773DD2355190 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -340,7 +339,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -418,7 +417,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -467,7 +466,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 9.0; + IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -547,6 +546,20 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { + isa = XCSwiftPackageProductDependency; + productName = FlutterGeneratedPluginSwiftPackage; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/packages/wifi_scan/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/wifi_scan/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a3..128d5765 100644 --- a/packages/wifi_scan/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/wifi_scan/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + diff --git a/packages/wifi_scan/example/ios/Runner/AppDelegate.swift b/packages/wifi_scan/example/ios/Runner/AppDelegate.swift index 70693e4a..c30b367e 100644 --- a/packages/wifi_scan/example/ios/Runner/AppDelegate.swift +++ b/packages/wifi_scan/example/ios/Runner/AppDelegate.swift @@ -1,13 +1,16 @@ -import UIKit import Flutter +import UIKit -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { +@main +@objc class AppDelegate: FlutterAppDelegate, FlutterImplicitEngineDelegate { override func application( _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - GeneratedPluginRegistrant.register(with: self) return super.application(application, didFinishLaunchingWithOptions: launchOptions) } + + func didInitializeImplicitFlutterEngine(_ engineBridge: FlutterImplicitEngineBridge) { + GeneratedPluginRegistrant.register(with: engineBridge.pluginRegistry) + } } diff --git a/packages/wifi_scan/example/ios/Runner/Info.plist b/packages/wifi_scan/example/ios/Runner/Info.plist index 83f86d25..3ba3efc3 100644 --- a/packages/wifi_scan/example/ios/Runner/Info.plist +++ b/packages/wifi_scan/example/ios/Runner/Info.plist @@ -2,6 +2,8 @@ + CADisableMinimumFrameDurationOnPhone + CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName @@ -24,6 +26,29 @@ $(FLUTTER_BUILD_NUMBER) LSRequiresIPhoneOS + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneClassName + UIWindowScene + UISceneConfigurationName + flutter + UISceneDelegateClassName + FlutterSceneDelegate + UISceneStoryboardFile + Main + + + + + UIApplicationSupportsIndirectInputEvents + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/packages/wifi_scan/example/lib/main.dart b/packages/wifi_scan/example/lib/main.dart index 9a409ab3..c3a7ffb2 100644 --- a/packages/wifi_scan/example/lib/main.dart +++ b/packages/wifi_scan/example/lib/main.dart @@ -11,7 +11,7 @@ void main() { /// Example app for wifi_scan plugin. class MyApp extends StatefulWidget { /// Default constructor for [MyApp] widget. - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override State createState() => _MyAppState(); @@ -96,7 +96,7 @@ class _MyAppState extends State { Row( children: [ if (label != null) Text(label), - Switch(value: value, onChanged: onChanged, activeColor: activeColor), + Switch(value: value, onChanged: onChanged, activeThumbColor: activeColor), ], ); @@ -169,8 +169,7 @@ class _MyAppState extends State { class _AccessPointTile extends StatelessWidget { final WiFiAccessPoint accessPoint; - const _AccessPointTile({Key? key, required this.accessPoint}) - : super(key: key); + const _AccessPointTile({required this.accessPoint}); // build row that can display info, based on label: value pair. Widget _buildInfo(String label, dynamic value) => Container( diff --git a/packages/wifi_scan/example/pubspec.yaml b/packages/wifi_scan/example/pubspec.yaml index 20ed8aed..3c9abeea 100644 --- a/packages/wifi_scan/example/pubspec.yaml +++ b/packages/wifi_scan/example/pubspec.yaml @@ -6,7 +6,7 @@ description: Demonstrates how to use the wifi_scan plugin. publish_to: 'none' # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ^3.12.0 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -28,7 +28,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 + cupertino_icons: ^1.0.8 dev_dependencies: flutter_test: @@ -39,7 +39,7 @@ dev_dependencies: # activated in the `analysis_options.yaml` file located at the root of your # package. See that file for information about deactivating specific lint # rules and activating additional ones. - flutter_lints: ^2.0.0 + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec diff --git a/packages/wifi_scan/ios/Assets/.gitkeep b/packages/wifi_scan/ios/Assets/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/packages/wifi_scan/ios/Classes/WifiScanPlugin.h b/packages/wifi_scan/ios/Classes/WifiScanPlugin.h deleted file mode 100644 index 8e0a099e..00000000 --- a/packages/wifi_scan/ios/Classes/WifiScanPlugin.h +++ /dev/null @@ -1,4 +0,0 @@ -#import - -@interface WifiScanPlugin : NSObject -@end diff --git a/packages/wifi_scan/ios/Classes/WifiScanPlugin.m b/packages/wifi_scan/ios/Classes/WifiScanPlugin.m deleted file mode 100644 index ac168139..00000000 --- a/packages/wifi_scan/ios/Classes/WifiScanPlugin.m +++ /dev/null @@ -1,15 +0,0 @@ -#import "WifiScanPlugin.h" -#if __has_include() -#import -#else -// Support project import fallback if the generated compatibility header -// is not copied when this plugin is created as a library. -// https://forums.swift.org/t/swift-static-libraries-dont-copy-generated-objective-c-header/19816 -#import "wifi_scan-Swift.h" -#endif - -@implementation WifiScanPlugin -+ (void)registerWithRegistrar:(NSObject *)registrar { - [SwiftWifiScanPlugin registerWithRegistrar:registrar]; -} -@end diff --git a/packages/wifi_scan/ios/wifi_scan.podspec b/packages/wifi_scan/ios/wifi_scan.podspec index 2c085d1d..0ff10130 100644 --- a/packages/wifi_scan/ios/wifi_scan.podspec +++ b/packages/wifi_scan/ios/wifi_scan.podspec @@ -13,9 +13,9 @@ Flutter plugin to scan for nearby visible WiFi access points. s.license = { :file => '../LICENSE' } s.author = { 'WiFiFlutter' => 'contact@flutternetwork.dev' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' + s.source_files = 'wifi_scan/Sources/wifi_scan/**/*.swift' s.dependency 'Flutter' - s.platform = :ios, '9.0' + s.platform = :ios, '13.0' # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } diff --git a/packages/wifi_scan/ios/wifi_scan/Package.swift b/packages/wifi_scan/ios/wifi_scan/Package.swift new file mode 100644 index 00000000..b6662df0 --- /dev/null +++ b/packages/wifi_scan/ios/wifi_scan/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version: 5.9 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "wifi_scan", + platforms: [ + .iOS("13.0") + ], + products: [ + .library(name: "wifi-scan", targets: ["wifi_scan"]) + ], + dependencies: [ + .package(name: "FlutterFramework", path: "../FlutterFramework") + ], + targets: [ + .target( + name: "wifi_scan", + dependencies: [ + .product(name: "FlutterFramework", package: "FlutterFramework") + ], + resources: [ + // If your plugin requires a privacy manifest, for example if it uses any required + // reason APIs, update the PrivacyInfo.xcprivacy file to describe your plugin's + // privacy impact, and then uncomment these lines. For more information, see + // https://developer.apple.com/documentation/bundleresources/privacy_manifest_files + // .process("PrivacyInfo.xcprivacy"), + + // If you have other resources that need to be bundled with your plugin, refer to + // the following instructions to add them: + // https://developer.apple.com/documentation/xcode/bundling-resources-with-a-swift-package + ] + ) + ] +) diff --git a/packages/wifi_scan/ios/Classes/SwiftWifiScanPlugin.swift b/packages/wifi_scan/ios/wifi_scan/Sources/wifi_scan/WifiScanPlugin.swift similarity index 93% rename from packages/wifi_scan/ios/Classes/SwiftWifiScanPlugin.swift rename to packages/wifi_scan/ios/wifi_scan/Sources/wifi_scan/WifiScanPlugin.swift index 10e40084..3457a20f 100644 --- a/packages/wifi_scan/ios/Classes/SwiftWifiScanPlugin.swift +++ b/packages/wifi_scan/ios/wifi_scan/Sources/wifi_scan/WifiScanPlugin.swift @@ -3,9 +3,9 @@ import Flutter // Since no API for scanning or getting scanned results in iOS. // This class is just a "stub" implementation with sane returns. // It is maintained to avoid `MissingPluginException`. -public class SwiftWifiScanPlugin: NSObject, FlutterPlugin { +public class WifiScanPlugin: NSObject, FlutterPlugin { public static func register(with registrar: FlutterPluginRegistrar) { - let instance = SwiftWifiScanPlugin() + let instance = WifiScanPlugin() // set Flutter channels - 1 for method, 1 for event let channel = FlutterMethodChannel( name: "wifi_scan", binaryMessenger: registrar.messenger() diff --git a/packages/wifi_scan/pubspec.yaml b/packages/wifi_scan/pubspec.yaml index 6fc5bd72..7927bfb7 100644 --- a/packages/wifi_scan/pubspec.yaml +++ b/packages/wifi_scan/pubspec.yaml @@ -1,11 +1,11 @@ name: wifi_scan description: Flutter plugin to scan for nearby visible WiFi access points. -version: 0.4.1+2 +version: 0.4.1+3 homepage: https://github.com/flutternetwork/WiFiFlutter/tree/master/packages/wifi_scan environment: - sdk: ">=2.12.0 <3.0.0" - flutter: ">=3.0.0" + sdk: ^3.12.0 + flutter: ">=3.44.0" dependencies: flutter: @@ -14,7 +14,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^6.0.0 # For information on the generic Dart part of this file, see the # following page: https://dart.dev/tools/pub/pubspec @@ -24,7 +24,7 @@ flutter: # This section identifies this Flutter project as a plugin project. # The 'pluginClass' and Android 'package' identifiers should not ordinarily # be modified. They are used by the tooling to maintain consistency when - # adding or updating assets for this project. + # adding or updating assets for the project. plugin: platforms: android: diff --git a/pubspec.lock b/pubspec.lock index 4968248f..bce4efd8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -25,14 +25,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" charcode: dependency: transitive description: @@ -41,6 +33,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: "959525d3162f249993882720d52b7e0c833978df229be20702b33d48d91de70f" + url: "https://pub.dev" + source: hosted + version: "2.0.4" cli_launcher: dependency: transitive description: @@ -69,26 +69,26 @@ packages: dependency: transitive description: name: conventional_commit - sha256: dec15ad1118f029c618651a4359eb9135d8b88f761aa24e4016d061cd45948f2 + sha256: c40b1b449ce2a63fa2ce852f35e3890b1e182f5951819934c0e4a66254bc0dc3 url: "https://pub.dev" source: hosted - version: "0.6.0+1" + version: "0.6.1+1" file: dependency: transitive description: name: file - sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "6.1.4" + version: "7.0.1" flutter_lints: dependency: "direct dev" description: name: flutter_lints - sha256: a25a15ebbdfc33ab1cd26c63a6ee519df92338a9c10f122adda92938253bef04 + sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "6.0.0" glob: dependency: transitive description: @@ -141,26 +141,18 @@ packages: dependency: transitive description: name: lints - sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" + sha256: "12f842a479589fea194fe5c5a3095abc7be0c1f2ddfa9a0e76aed1dbd26a87df" url: "https://pub.dev" source: hosted - version: "2.1.1" - matcher: - dependency: transitive - description: - name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.dev" - source: hosted - version: "0.12.16+1" + version: "6.1.0" melos: dependency: "direct dev" description: name: melos - sha256: "96e64bbade5712c3f010137e195bca9f1b351fac34ab1f322af492ae34032067" + sha256: "4280dc46bd5b741887cce1e67e5c1a6aaf3c22310035cf5bd33dceeeda62ed22" url: "https://pub.dev" source: hosted - version: "3.4.0" + version: "6.3.3" meta: dependency: transitive description: @@ -205,10 +197,10 @@ packages: dependency: transitive description: name: process - sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + sha256: c6248e4526673988586e8c00bb22a49210c258dc91df5227d5da9748ecf79744 url: "https://pub.dev" source: hosted - version: "4.2.4" + version: "5.0.5" prompts: dependency: transitive description: @@ -229,26 +221,18 @@ packages: dependency: transitive description: name: pub_updater - sha256: b06600619c8c219065a548f8f7c192b3e080beff95488ed692780f48f69c0625 + sha256: "739a0161d73a6974c0675b864fb0cf5147305f7b077b7f03a58fa7a9ab3e7e7d" url: "https://pub.dev" source: hosted - version: "0.3.1" - pubspec: + version: "0.5.0" + pubspec_parse: dependency: transitive description: - name: pubspec - sha256: f534a50a2b4d48dc3bc0ec147c8bd7c304280fff23b153f3f11803c4d49d927e + name: pubspec_parse + sha256: "0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082" url: "https://pub.dev" source: hosted - version: "2.3.0" - quiver: - dependency: transitive - description: - name: quiver - sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47 - url: "https://pub.dev" - source: hosted - version: "3.2.1" + version: "1.5.0" source_span: dependency: transitive description: @@ -265,14 +249,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" - source: hosted - version: "2.1.2" string_scanner: dependency: transitive description: @@ -289,14 +265,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" - url: "https://pub.dev" - source: hosted - version: "0.7.3" typed_data: dependency: transitive description: @@ -305,14 +273,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - uri: - dependency: transitive - description: - name: uri - sha256: "889eea21e953187c6099802b7b4cf5219ba8f3518f604a1033064d45b1b8268a" - url: "https://pub.dev" - source: hosted - version: "1.0.0" web: dependency: transitive description: @@ -338,4 +298,4 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=3.4.0 <4.0.0" + dart: ">=3.12.0 <4.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index 001f4043..68bb384b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,8 +1,7 @@ name: wifi_flutter environment: - sdk: '>=2.18.0 <3.0.0' + sdk: ^3.12.0 dev_dependencies: - melos: ^3.1.1 - flutter_lints: ^2.0.0 - + melos: ^6.3.3 + flutter_lints: ^6.0.0