From bc95ca2ce6a363c86cddb0a9c1d622af63ed6a5e Mon Sep 17 00:00:00 2001 From: Rami Al-Dhafiri Date: Sun, 7 Jul 2024 12:17:42 +0300 Subject: [PATCH 01/14] Update pubspec.yaml --- pubspec.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 080e881c..52217208 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -7,6 +7,7 @@ dependencies: flutter: sdk: flutter ffi: ^2.0.1 + web: ^0.5.0 dev_dependencies: flutter_lints: ^2.0.1 @@ -31,4 +32,4 @@ flutter: macos: default_package: open_filex web: - default_package: open_filex \ No newline at end of file + default_package: open_filex From 44a9700aedc3ae7bfacd043cbc2dacbf4feb394d Mon Sep 17 00:00:00 2001 From: Rami Al-Dhafiri Date: Sun, 7 Jul 2024 12:18:00 +0300 Subject: [PATCH 02/14] Update open_filex.dart --- lib/open_filex.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/open_filex.dart b/lib/open_filex.dart index 98157faf..db047382 100644 --- a/lib/open_filex.dart +++ b/lib/open_filex.dart @@ -5,4 +5,4 @@ export 'src/common/open_result.dart'; /// Use platform specific codes or use web if it's the web export 'src/platform/open_filex.dart' - if (dart.library.html) 'src/web/open_filex.dart'; + if (dart.library.js_interop) 'src/web/open_filex.dart'; From ac2fe2d9af55a9e3b23363f9d9e49e9316232cb4 Mon Sep 17 00:00:00 2001 From: Rami Al-Dhafiri Date: Sun, 7 Jul 2024 12:31:44 +0300 Subject: [PATCH 03/14] Update web.dart --- lib/src/web/web.dart | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/src/web/web.dart b/lib/src/web/web.dart index d9804bd9..17665d5e 100644 --- a/lib/src/web/web.dart +++ b/lib/src/web/web.dart @@ -1,12 +1,9 @@ import 'dart:async'; // ignore: avoid_web_libraries_in_flutter -import 'dart:html'; +import 'package:web/web.dart'; /// Open your file with [uri] on the web Future open(String uri) async { - return window - .resolveLocalFileSystemUrl(uri) - .then((_) => true) - .catchError((e) => false); + return false; } From 87d0f166a219e256241fa6d76b8b927a42ec2fc1 Mon Sep 17 00:00:00 2001 From: ishaqhassan Date: Fri, 7 Mar 2025 08:10:52 +0500 Subject: [PATCH 04/14] Refactor Android Gradle build configuration to use Plugin DSL - Updates `settings.gradle` to use the declarative `pluginManagement` block for applying Flutter's Gradle plugins. - Removes the deprecated imperative `apply` method for loading plugins. - Updates `build.gradle` files to use the new plugin DSL. - Updates Gradle version to 8.7. - Updates compile and target sdk versions to be flutter's ones. - Removes deprecated `registerWith` method in `OpenFilePlugin`. --- .../crazecoder/openfile/OpenFilePlugin.java | 11 ------- example/android/app/build.gradle | 25 +++++++--------- example/android/build.gradle | 17 +---------- .../gradle/wrapper/gradle-wrapper.properties | 4 +-- example/android/settings.gradle | 30 ++++++++++++++----- 5 files changed, 35 insertions(+), 52 deletions(-) diff --git a/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java b/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java index 7bc3787c..e65a60b6 100644 --- a/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java +++ b/android/src/main/java/com/crazecoder/openfile/OpenFilePlugin.java @@ -69,17 +69,6 @@ public class OpenFilePlugin implements MethodCallHandler private static final int RESULT_CODE = 0x12; private static final String TYPE_STRING_APK = "application/vnd.android.package-archive"; - @Deprecated - public static void registerWith(PluginRegistry.Registrar registrar) { - OpenFilePlugin plugin = new OpenFilePlugin(); - plugin.activity = registrar.activity(); - plugin.context = registrar.context(); - plugin.channel = new MethodChannel(registrar.messenger(), "open_file"); - plugin.channel.setMethodCallHandler(plugin); - registrar.addRequestPermissionsResultListener(plugin); - registrar.addActivityResultListener(plugin); - } - private boolean hasPermission(String permission) { return ContextCompat.checkSelfPermission(activity, permission) == PermissionChecker.PERMISSION_GRANTED; } diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index 49b26506..a264013d 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,10 +12,6 @@ if (localPropertiesFile.exists()) { } } -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { @@ -21,13 +23,10 @@ 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 34 + compileSdkVersion flutter.compileSdkVersion ndkVersion flutter.ndkVersion + namespace "com.example.example" compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -48,7 +47,7 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion flutter.minSdkVersion - targetSdkVersion 34 + compileSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -64,8 +63,4 @@ android { flutter { source '../..' -} - -dependencies { - 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 0441e394..8f31e8ca 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,22 +1,7 @@ -buildscript { - ext.kotlin_version = '1.6.21' - repositories { - google() - mavenCentral() - maven { url "https://maven.google.com" } - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.3.1' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { google() mavenCentral() - maven { url "https://maven.google.com" } } } @@ -30,4 +15,4 @@ subprojects { tasks.register("clean", Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index cc5527d7..ca244fa2 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Fri Mar 07 07:40:16 PKT 2025 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip diff --git a/example/android/settings.gradle b/example/android/settings.gradle index 44e62bcf..d67f36eb 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -1,11 +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 localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } +} -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" +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.5.0" apply false + id "org.jetbrains.kotlin.android" version "2.0.10" apply false +} + +include ":app" From 4f2a23494a1726f215cf2be25226f679d6420c04 Mon Sep 17 00:00:00 2001 From: ishaqhassan Date: Fri, 7 Mar 2025 08:15:02 +0500 Subject: [PATCH 05/14] Update permission_handler dependency to version 11.4.0 in example pubspec.yaml --- example/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/pubspec.yaml b/example/pubspec.yaml index ca73f166..d530a2bb 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -12,7 +12,7 @@ dependencies: sdk: flutter open_filex: path: ../ - permission_handler: ^10.3.0 + permission_handler: ^11.4.0 dev_dependencies: flutter_test: From f425208d8486a24af8a3d01a712bfb91130bfb83 Mon Sep 17 00:00:00 2001 From: Muhammed-Ayad Date: Thu, 13 Mar 2025 13:26:20 +0200 Subject: [PATCH 06/14] Clean up AndroidManifest.xml by removing redundant package declaration --- android/src/main/AndroidManifest.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 12c36ca8..39aefeb4 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ + xmlns:tools="http://schemas.android.com/tools"> - + \ No newline at end of file From 8fb1ba47b865e7578633ada9aeea17db6bea7606 Mon Sep 17 00:00:00 2001 From: "frng\\a.rezaee" Date: Mon, 5 Jan 2026 13:51:50 +0330 Subject: [PATCH 07/14] updated CHANGELOG.md and settings.gradle, set version to 4.7.1 --- CHANGELOG.md | 3 +++ .../android/gradle/wrapper/gradle-wrapper.properties | 2 +- example/android/settings.gradle | 6 +++--- example/ios/Flutter/Debug.xcconfig | 1 + example/ios/Flutter/Release.xcconfig | 1 + example/lib/main.dart | 11 ++++------- example/macos/Flutter/Flutter-Debug.xcconfig | 1 + example/macos/Flutter/Flutter-Release.xcconfig | 1 + pubspec.yaml | 6 +++--- 9 files changed, 18 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b478cb25..4fc85418 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.7.1 +* Remove Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions. + ## 4.7.0 * Fix Android compatibility issues after Flutter 3.29.0 upgrade (Thanks to [mufassalhussain](https://github.com/mufassalhussain), PR[#19](https://github.com/javaherisaber/open_filex/pull/19)) diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index 91e61138..6bd38130 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-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-all.zip \ No newline at end of file diff --git a/example/android/settings.gradle b/example/android/settings.gradle index f2b64cfa..fa3695ae 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -17,9 +17,9 @@ pluginManagement { } plugins { - id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "8.1.0" apply false - id "org.jetbrains.kotlin.android" version "1.8.10" apply false + id("dev.flutter.flutter-plugin-loader") version "1.0.0" + id("com.android.application") version "8.11.1" apply false + id("org.jetbrains.kotlin.android") version "2.2.20" apply false } include ":app" diff --git a/example/ios/Flutter/Debug.xcconfig b/example/ios/Flutter/Debug.xcconfig index 592ceee8..ec97fc6f 100644 --- a/example/ios/Flutter/Debug.xcconfig +++ b/example/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/example/ios/Flutter/Release.xcconfig b/example/ios/Flutter/Release.xcconfig index 592ceee8..c4855bfe 100644 --- a/example/ios/Flutter/Release.xcconfig +++ b/example/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/example/lib/main.dart b/example/lib/main.dart index 3210c870..24d7220f 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -21,7 +21,7 @@ class MyAppState extends State { if (Platform.isLinux) { _openLinuxFile(); } else if (Platform.isAndroid) { - _openAndroidExternalImage(); + _openAndroidExternalFile(); } else if (Platform.isWindows) { _openWindowsFile(); } else if (Platform.isMacOS) { @@ -82,12 +82,11 @@ class MyAppState extends State { // ignore: unused_element _openAndroidExternalImage() async { //open an external storage image file on android 13 - if (await Permission.photos.request().isGranted) { - final result = await OpenFilex.open("/sdcard/Download/flutter.png"); + final result = await OpenFilex.open("/sdcard/Download/k.apk"); setState(() { _openResult = "type=${result.type} message=${result.message}"; }); - } + } // ignore: unused_element @@ -115,12 +114,10 @@ class MyAppState extends State { // ignore: unused_element _openAndroidExternalFile() async { //open an external storage file - if (await Permission.manageExternalStorage.request().isGranted) { - final result = await OpenFilex.open("/sdcard/Android/data/R-C.xml"); + final result = await OpenFilex.open("/sdcard/Download/k.apk"); setState(() { _openResult = "type=${result.type} message=${result.message}"; }); - } } @override diff --git a/example/macos/Flutter/Flutter-Debug.xcconfig b/example/macos/Flutter/Flutter-Debug.xcconfig index c2efd0b6..4b81f9b2 100644 --- a/example/macos/Flutter/Flutter-Debug.xcconfig +++ b/example/macos/Flutter/Flutter-Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/example/macos/Flutter/Flutter-Release.xcconfig b/example/macos/Flutter/Flutter-Release.xcconfig index c2efd0b6..5caa9d15 100644 --- a/example/macos/Flutter/Flutter-Release.xcconfig +++ b/example/macos/Flutter/Flutter-Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "ephemeral/Flutter-Generated.xcconfig" diff --git a/pubspec.yaml b/pubspec.yaml index eff467d3..7cae0813 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ -name: open_filex +name: open_filex_plus description: A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html) -version: 4.7.0 -homepage: https://github.com/javaherisaber/open_file +version: 4.7.1 +homepage: https://github.com/armin1440/open_filex dependencies: flutter: From 812b8dfc3b46d4493b74c2544f0c0bf9e02ea3a2 Mon Sep 17 00:00:00 2001 From: "frng\\a.rezaee" Date: Mon, 5 Jan 2026 14:00:09 +0330 Subject: [PATCH 08/14] renamed files, final version 4.7.1 --- example/lib/main.dart | 2 +- lib/{open_filex.dart => open_filex_plus.dart} | 0 lib/src/platform/open_filex.dart | 3 ++- lib/src/web/open_filex.dart | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) rename lib/{open_filex.dart => open_filex_plus.dart} (100%) diff --git a/example/lib/main.dart b/example/lib/main.dart index 24d7220f..cdb88e5d 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -2,7 +2,7 @@ import 'dart:async'; import 'dart:io'; import 'package:flutter/material.dart'; -import 'package:open_filex/open_filex.dart'; +import 'package:open_filex/open_filex_plus.dart'; import 'package:permission_handler/permission_handler.dart'; void main() => runApp(const MyApp()); diff --git a/lib/open_filex.dart b/lib/open_filex_plus.dart similarity index 100% rename from lib/open_filex.dart rename to lib/open_filex_plus.dart diff --git a/lib/src/platform/open_filex.dart b/lib/src/platform/open_filex.dart index 40bca860..33775f6a 100644 --- a/lib/src/platform/open_filex.dart +++ b/lib/src/platform/open_filex.dart @@ -3,7 +3,8 @@ import 'dart:convert'; import 'dart:io'; import 'package:flutter/services.dart'; -import 'package:open_filex/src/common/open_result.dart'; + +import '../../open_filex_plus.dart'; /// OpenFilex class class OpenFilex { diff --git a/lib/src/web/open_filex.dart b/lib/src/web/open_filex.dart index c9b8c35e..5a0ca1e1 100644 --- a/lib/src/web/open_filex.dart +++ b/lib/src/web/open_filex.dart @@ -1,5 +1,5 @@ import 'dart:async'; -import 'package:open_filex/src/common/open_result.dart'; +import 'package:open_filex_plus/src/common/open_result.dart'; import 'web.dart' as web; From ff1f409eaae24c792de256badeddffa9b042f964 Mon Sep 17 00:00:00 2001 From: "frng\\a.rezaee" Date: Mon, 5 Jan 2026 14:20:52 +0330 Subject: [PATCH 09/14] fixed removing Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions --- CHANGELOG.md | 3 +++ android/src/main/AndroidManifest.xml | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fc85418..56e08efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.7.2 +* Remove Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions. The previous had bugs. + ## 4.7.1 * Remove Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions. diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 12c36ca8..cb644e16 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -6,10 +6,6 @@ android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" /> - - - - Date: Mon, 5 Jan 2026 14:23:30 +0330 Subject: [PATCH 10/14] set version to 4.7.2 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 7cae0813..2db476aa 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: open_filex_plus description: A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html) -version: 4.7.1 +version: 4.7.2 homepage: https://github.com/armin1440/open_filex dependencies: From c3f745a5017445c62f7ca469856f7f0703d67455 Mon Sep 17 00:00:00 2001 From: armin1440 Date: Sun, 1 Feb 2026 18:43:12 +0330 Subject: [PATCH 11/14] renamed podspec file name and its s.name in it from "open_filex" to "open_filex_plus" --- ios/{open_filex.podspec => open_filex_plus.podspec} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename ios/{open_filex.podspec => open_filex_plus.podspec} (93%) diff --git a/ios/open_filex.podspec b/ios/open_filex_plus.podspec similarity index 93% rename from ios/open_filex.podspec rename to ios/open_filex_plus.podspec index 9765688c..64f6d20a 100644 --- a/ios/open_filex.podspec +++ b/ios/open_filex_plus.podspec @@ -2,7 +2,7 @@ # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html # Pod::Spec.new do |s| - s.name = 'open_filex' + s.name = 'open_filex_plus' s.version = '0.0.2' s.summary = 'A new Flutter project.' s.description = <<-DESC From ad0b3301ae950cb6954467f978261d6ff87b50f4 Mon Sep 17 00:00:00 2001 From: armin1440 Date: Sun, 1 Feb 2026 18:45:26 +0330 Subject: [PATCH 12/14] version 4.7.3 --- CHANGELOG.md | 3 +++ pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e08efd..e544fc95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 4.7.3 +* Fixed ios podspec + ## 4.7.2 * Remove Android READ_MEDIA_IMAGES/READ_MEDIA_VIDEO permissions. The previous had bugs. diff --git a/pubspec.yaml b/pubspec.yaml index 2db476aa..bc966e88 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: open_filex_plus description: A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html) -version: 4.7.2 +version: 4.7.3 homepage: https://github.com/armin1440/open_filex dependencies: From 4c3d70ce2ceaf9e8583740164d86b14f4aef917f Mon Sep 17 00:00:00 2001 From: Eli Geller Date: Mon, 8 Jun 2026 21:58:40 -0400 Subject: [PATCH 13/14] Migrate to Swift Package Manager --- example/.gitignore | 2 ++ example/ios/Flutter/AppFrameworkInfo.plist | 2 -- example/ios/Runner.xcodeproj/project.pbxproj | 35 ++++++++++++++++--- .../xcshareddata/xcschemes/Runner.xcscheme | 23 +++++++++++- example/ios/Runner/AppDelegate.swift | 11 +++--- example/ios/Runner/Info.plist | 27 ++++++++++++-- ios/.gitignore | 1 + ios/open_filex.podspec | 8 ++--- ios/open_filex/Package.swift | 24 +++++++++++++ .../Sources/open_filex}/OpenFilePlugin.m | 0 .../include/open_filex}/OpenFilePlugin.h | 0 11 files changed, 115 insertions(+), 18 deletions(-) create mode 100644 ios/open_filex/Package.swift rename ios/{Classes => open_filex/Sources/open_filex}/OpenFilePlugin.m (100%) rename ios/{Classes => open_filex/Sources/open_filex/include/open_filex}/OpenFilePlugin.h (100%) diff --git a/example/.gitignore b/example/.gitignore index a8e938c0..221b4225 100644 --- a/example/.gitignore +++ b/example/.gitignore @@ -5,9 +5,11 @@ *.swp .DS_Store .atom/ +.build/ .buildlog/ .history .svn/ +.swiftpm/ migrate_working_dir/ # IntelliJ related diff --git a/example/ios/Flutter/AppFrameworkInfo.plist b/example/ios/Flutter/AppFrameworkInfo.plist index 8d4492f9..391a902b 100644 --- a/example/ios/Flutter/AppFrameworkInfo.plist +++ b/example/ios/Flutter/AppFrameworkInfo.plist @@ -20,7 +20,5 @@ ???? CFBundleVersion 1.0 - MinimumOSVersion - 9.0 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index 6edd238e..924c386c 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 50; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -13,6 +13,7 @@ 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 */; }; + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -42,6 +43,7 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = FlutterGeneratedPluginSwiftPackage; path = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -49,6 +51,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -58,6 +61,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 78E0A7A72DC9AD7400C4905E /* FlutterGeneratedPluginSwiftPackage */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, @@ -102,6 +106,9 @@ /* Begin PBXNativeTarget section */ 97C146ED1CF9000F007C117D /* Runner */ = { + packageProductDependencies = ( + 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, + ); isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( @@ -125,9 +132,12 @@ /* Begin PBXProject section */ 97C146E61CF9000F007C117D /* Project object */ = { + packageReferences = ( + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage" */, + ); isa = PBXProject; attributes = { - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { @@ -171,10 +181,12 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); inputPaths = ( + "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", ); name = "Thin Binary"; outputPaths = ( @@ -185,6 +197,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -272,7 +285,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; @@ -349,7 +362,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; @@ -398,7 +411,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; @@ -476,6 +489,18 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ +/* Begin XCLocalSwiftPackageReference section */ + 781AD8BC2B33823900A9FFBB /* XCLocalSwiftPackageReference "Flutter/ephemeral/Packages/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/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a3..5db441f5 100644 --- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,10 +1,28 @@ + + + + + + + + + + diff --git a/example/ios/Runner/AppDelegate.swift b/example/ios/Runner/AppDelegate.swift index 70693e4a..c30b367e 100644 --- a/example/ios/Runner/AppDelegate.swift +++ b/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/example/ios/Runner/Info.plist b/example/ios/Runner/Info.plist index 907f329f..01e816d3 100644 --- a/example/ios/Runner/Info.plist +++ b/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 @@ -43,7 +68,5 @@ UIViewControllerBasedStatusBarAppearance - CADisableMinimumFrameDurationOnPhone - diff --git a/ios/.gitignore b/ios/.gitignore index 710ec6cf..639cbaf6 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -9,6 +9,7 @@ profile DerivedData/ build/ +.build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m diff --git a/ios/open_filex.podspec b/ios/open_filex.podspec index 9765688c..202a09a0 100644 --- a/ios/open_filex.podspec +++ b/ios/open_filex.podspec @@ -12,10 +12,10 @@ A new Flutter project. s.license = { :file => '../LICENSE' } s.author = { 'Your Company' => 'email@example.com' } s.source = { :path => '.' } - s.source_files = 'Classes/**/*' - s.public_header_files = 'Classes/**/*.h' + s.source_files = 'open_filex/Sources/open_filex/**/*.{h,m}' + s.public_header_files = 'open_filex/Sources/open_filex/include/**/*.h' s.dependency 'Flutter' - - s.ios.deployment_target = '8.0' + + s.ios.deployment_target = '13.0' end diff --git a/ios/open_filex/Package.swift b/ios/open_filex/Package.swift new file mode 100644 index 00000000..a9f5adb8 --- /dev/null +++ b/ios/open_filex/Package.swift @@ -0,0 +1,24 @@ +// 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: "open_filex", + platforms: [ + .iOS("13.0") + ], + products: [ + .library(name: "open-filex", targets: ["open_filex"]) + ], + dependencies: [], + targets: [ + .target( + name: "open_filex", + dependencies: [], + cSettings: [ + .headerSearchPath("include/open_filex") + ] + ) + ] +) diff --git a/ios/Classes/OpenFilePlugin.m b/ios/open_filex/Sources/open_filex/OpenFilePlugin.m similarity index 100% rename from ios/Classes/OpenFilePlugin.m rename to ios/open_filex/Sources/open_filex/OpenFilePlugin.m diff --git a/ios/Classes/OpenFilePlugin.h b/ios/open_filex/Sources/open_filex/include/open_filex/OpenFilePlugin.h similarity index 100% rename from ios/Classes/OpenFilePlugin.h rename to ios/open_filex/Sources/open_filex/include/open_filex/OpenFilePlugin.h From 62853f6686f700fe44c73ddf233b43525e56fc0f Mon Sep 17 00:00:00 2001 From: Rahimli <62797403+arahimli@users.noreply.github.com> Date: Mon, 31 Aug 2026 10:27:53 +0400 Subject: [PATCH 14/14] Add local open_filex package and remove unused media/web permissions --- lib/open_filex.dart | 7 +++++++ lib/open_filex_plus.dart | 8 -------- lib/src/platform/open_filex.dart | 2 +- lib/src/web/open_filex.dart | 21 --------------------- lib/src/web/web.dart | 9 --------- melos_open_filex.iml | 29 +++++++++++++++++++++++++++++ melos_open_filex_plus.iml | 29 +++++++++++++++++++++++++++++ pubspec.yaml | 16 ++-------------- 8 files changed, 68 insertions(+), 53 deletions(-) create mode 100644 lib/open_filex.dart delete mode 100644 lib/open_filex_plus.dart delete mode 100644 lib/src/web/open_filex.dart delete mode 100644 lib/src/web/web.dart create mode 100644 melos_open_filex.iml create mode 100644 melos_open_filex_plus.iml diff --git a/lib/open_filex.dart b/lib/open_filex.dart new file mode 100644 index 00000000..4602a1ac --- /dev/null +++ b/lib/open_filex.dart @@ -0,0 +1,7 @@ +library open_filex; + +/// OpenResult is a class to inform result of platform +export 'src/common/open_result.dart'; + +/// Use platform specific codes +export 'src/platform/open_filex.dart'; diff --git a/lib/open_filex_plus.dart b/lib/open_filex_plus.dart deleted file mode 100644 index db047382..00000000 --- a/lib/open_filex_plus.dart +++ /dev/null @@ -1,8 +0,0 @@ -library open_filex; - -/// OpenResult is a class to inform result of platform -export 'src/common/open_result.dart'; - -/// Use platform specific codes or use web if it's the web -export 'src/platform/open_filex.dart' - if (dart.library.js_interop) 'src/web/open_filex.dart'; diff --git a/lib/src/platform/open_filex.dart b/lib/src/platform/open_filex.dart index 33775f6a..bfb6de66 100644 --- a/lib/src/platform/open_filex.dart +++ b/lib/src/platform/open_filex.dart @@ -4,7 +4,7 @@ import 'dart:io'; import 'package:flutter/services.dart'; -import '../../open_filex_plus.dart'; +import '../../open_filex.dart'; /// OpenFilex class class OpenFilex { diff --git a/lib/src/web/open_filex.dart b/lib/src/web/open_filex.dart deleted file mode 100644 index 5a0ca1e1..00000000 --- a/lib/src/web/open_filex.dart +++ /dev/null @@ -1,21 +0,0 @@ -import 'dart:async'; -import 'package:open_filex_plus/src/common/open_result.dart'; - -import 'web.dart' as web; - -/// OpenFilex class -class OpenFilex { - OpenFilex._(); - - /// Open your file with provided [filePath] in the corresponding app on the running platform - static Future open(String? filePath, - {String? type, - String? uti, - String linuxDesktopName = "xdg", - bool linuxByProcess = false}) async { - final b = await web.open("file://$filePath"); - return OpenResult( - type: b ? ResultType.done : ResultType.error, - message: b ? "done" : "there are some errors when open $filePath"); - } -} diff --git a/lib/src/web/web.dart b/lib/src/web/web.dart deleted file mode 100644 index 17665d5e..00000000 --- a/lib/src/web/web.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'dart:async'; - -// ignore: avoid_web_libraries_in_flutter -import 'package:web/web.dart'; - -/// Open your file with [uri] on the web -Future open(String uri) async { - return false; -} diff --git a/melos_open_filex.iml b/melos_open_filex.iml new file mode 100644 index 00000000..9fc8ce79 --- /dev/null +++ b/melos_open_filex.iml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/melos_open_filex_plus.iml b/melos_open_filex_plus.iml new file mode 100644 index 00000000..9fc8ce79 --- /dev/null +++ b/melos_open_filex_plus.iml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/pubspec.yaml b/pubspec.yaml index 44bb0039..88b82020 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,4 +1,4 @@ -name: open_filex_plus +name: open_filex description: A plug-in that can call native APP to open files with string result in flutter, support iOS(UTI) / android(intent) / PC(ffi) / web(dart:html) version: 4.7.3 homepage: https://github.com/armin1440/open_filex @@ -6,8 +6,6 @@ homepage: https://github.com/armin1440/open_filex dependencies: flutter: sdk: flutter - ffi: ^2.0.1 - web: ^0.5.0 dev_dependencies: flutter_lints: ^2.0.1 @@ -24,14 +22,4 @@ flutter: package: com.crazecoder.openfile pluginClass: OpenFilePlugin ios: - pluginClass: OpenFilePlugin - - windows: - default_package: open_filex - linux: - default_package: open_filex - macos: - default_package: open_filex - web: - default_package: open_filex -x + pluginClass: OpenFilePlugin \ No newline at end of file