An open-source cross-platform alternative to AirDrop
refactor: replace open_filex with open_file
Tien Do Nam7a06197b09d9
diff --git a/app/lib/util/native/open_file.dart b/app/lib/util/native/open_file.dartindex 7c1979b4..9d1754ed 100644--- a/app/lib/util/native/open_file.dart+++ b/app/lib/util/native/open_file.dart@@ -3,7 +3,7 @@ import 'package:localsend_app/util/native/channel/android_channel.dart' as androimport 'package:localsend_app/util/native/platform_check.dart';import 'package:localsend_app/widget/dialogs/cannot_open_file_dialog.dart';import 'package:localsend_isolates/model/file_type.dart';-import 'package:open_filex/open_filex.dart';+import 'package:open_file/open_file.dart';import 'package:permission_handler/permission_handler.dart';/// Opens the selected file which is stored on the device.@@ -22,7 +22,7 @@ Future<void> openFile(return;}- final fileOpenResult = await OpenFilex.open(filePath);+ final fileOpenResult = await OpenFile.open(filePath);if (fileOpenResult.type != ResultType.done && context.mounted) {await CannotOpenFileDialog.open(context, filePath, onDeleteTap);}diff --git a/app/lib/util/native/open_folder.dart b/app/lib/util/native/open_folder.dartindex dfaef8f9..20c463b1 100644--- a/app/lib/util/native/open_folder.dart+++ b/app/lib/util/native/open_folder.dart@@ -4,7 +4,7 @@ import 'package:flutter/foundation.dart';import 'package:localsend_app/util/native/channel/android_channel.dart' as android_channel;import 'package:localsend_app/util/native/platform_check.dart';import 'package:logging/logging.dart';-import 'package:open_filex/open_filex.dart';+import 'package:open_file/open_file.dart';final _logger = Logger('OpenFolder');@@ -37,7 +37,7 @@ Future<void> openFolder({folderPath = '$folderPath/';}- final result = await OpenFilex.open(folderPath);+ final result = await OpenFile.open(folderPath);_logger.info('Open folder result: ${result.message}, path: $folderPath');}diff --git a/app/linux/flutter/generated_plugin_registrant.cc b/app/linux/flutter/generated_plugin_registrant.ccindex 00e865c3..a4a2aa39 100644--- a/app/linux/flutter/generated_plugin_registrant.cc+++ b/app/linux/flutter/generated_plugin_registrant.cc@@ -10,6 +10,7 @@#include <dynamic_color/dynamic_color_plugin.h>#include <file_selector_linux/file_selector_plugin.h>#include <gtk/gtk_plugin.h>+#include <open_file_linux/open_file_linux_plugin.h>#include <pasteboard/pasteboard_plugin.h>#include <screen_retriever_linux/screen_retriever_linux_plugin.h>#include <tray_manager/tray_manager_plugin.h>@@ -31,6 +32,9 @@ void fl_register_plugins(FlPluginRegistry* registry) {g_autoptr(FlPluginRegistrar) gtk_registrar =fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");gtk_plugin_register_with_registrar(gtk_registrar);+ g_autoptr(FlPluginRegistrar) open_file_linux_registrar =+ fl_plugin_registry_get_registrar_for_plugin(registry, "OpenFileLinuxPlugin");+ open_file_linux_plugin_register_with_registrar(open_file_linux_registrar);g_autoptr(FlPluginRegistrar) pasteboard_registrar =fl_plugin_registry_get_registrar_for_plugin(registry, "PasteboardPlugin");pasteboard_plugin_register_with_registrar(pasteboard_registrar);diff --git a/app/linux/flutter/generated_plugins.cmake b/app/linux/flutter/generated_plugins.cmakeindex abb3914a..a6e141d9 100644--- a/app/linux/flutter/generated_plugins.cmake+++ b/app/linux/flutter/generated_plugins.cmake@@ -7,6 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LISTdynamic_colorfile_selector_linuxgtk+ open_file_linuxpasteboardscreen_retriever_linuxtray_managerdiff --git a/app/macos/Flutter/GeneratedPluginRegistrant.swift b/app/macos/Flutter/GeneratedPluginRegistrant.swiftindex dd090376..05a22d56 100644--- a/app/macos/Flutter/GeneratedPluginRegistrant.swift+++ b/app/macos/Flutter/GeneratedPluginRegistrant.swift@@ -14,6 +14,7 @@ import file_selector_macosimport galimport in_app_purchase_storekitimport network_info_plus+import open_file_macimport package_info_plusimport pasteboardimport photo_manager@@ -36,6 +37,7 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {GalPlugin.register(with: registry.registrar(forPlugin: "GalPlugin"))InAppPurchasePlugin.register(with: registry.registrar(forPlugin: "InAppPurchasePlugin"))NetworkInfoPlusPlugin.register(with: registry.registrar(forPlugin: "NetworkInfoPlusPlugin"))+ OpenFilePlugin.register(with: registry.registrar(forPlugin: "OpenFilePlugin"))FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))PhotoManagerPlugin.register(with: registry.registrar(forPlugin: "PhotoManagerPlugin"))diff --git a/app/macos/Podfile.lock b/app/macos/Podfile.lockindex 10838cc8..e1a2da89 100644--- a/app/macos/Podfile.lock+++ b/app/macos/Podfile.lock@@ -21,6 +21,8 @@ PODS:- FlutterMacOS- network_info_plus (0.0.1):- FlutterMacOS+ - open_file_mac (1.0.3):+ - FlutterMacOS- package_info_plus (0.0.1):- FlutterMacOS- pasteboard (0.0.1):@@ -61,6 +63,7 @@ DEPENDENCIES:- gal (from `Flutter/ephemeral/.symlinks/plugins/gal/darwin`)- in_app_purchase_storekit (from `Flutter/ephemeral/.symlinks/plugins/in_app_purchase_storekit/darwin`)- network_info_plus (from `Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos`)+ - open_file_mac (from `Flutter/ephemeral/.symlinks/plugins/open_file_mac/macos`)- package_info_plus (from `Flutter/ephemeral/.symlinks/plugins/package_info_plus/macos`)- pasteboard (from `Flutter/ephemeral/.symlinks/plugins/pasteboard/macos`)- photo_manager (from `Flutter/ephemeral/.symlinks/plugins/photo_manager/darwin`)@@ -99,6 +102,8 @@ EXTERNAL SOURCES::path: Flutter/ephemeral/.symlinks/plugins/in_app_purchase_storekit/darwinnetwork_info_plus::path: Flutter/ephemeral/.symlinks/plugins/network_info_plus/macos+ open_file_mac:+ :path: Flutter/ephemeral/.symlinks/plugins/open_file_mac/macospackage_info_plus::path: Flutter/ephemeral/.symlinks/plugins/package_info_plus/macospasteboard:@@ -136,6 +141,7 @@ SPEC CHECKSUMS:gal: baecd024ebfd13c441269ca7404792a7152fde89in_app_purchase_storekit: 22cca7d08eebca9babdf4d07d0baccb73325d3c8network_info_plus: 21d1cd6a015ccb2fdff06a1fbfa88d54b4e92f61+ open_file_mac: 76f06c8597551249bdb5e8fd8827a98eae0f4585package_info_plus: f0052d280d17aa382b932f399edf32507174e870pasteboard: 278d8100149f940fb795d6b3a74f0720c890ecb7photo_manager: c303e4476f6c220274119f0212a7753e45edd4a2diff --git a/app/pubspec.yaml b/app/pubspec.yamlindex 33d2ce83..56aa4deb 100644--- a/app/pubspec.yaml+++ b/app/pubspec.yaml@@ -43,7 +43,7 @@ dependencies:moform: 0.2.11nanoid2: 2.0.1network_info_plus: 7.0.0- open_filex: 4.7.0+ open_file: 4.0.0package_info_plus: 9.0.1pasteboard: 0.3.0path: 1.9.1diff --git a/pubspec.lock b/pubspec.lockindex d104c6dd..633dba40 100644--- a/pubspec.lock+++ b/pubspec.lock@@ -1022,14 +1022,70 @@ packages:url: "https://pub.dev"source: hostedversion: "9.5.0"- open_filex:+ open_file:dependency: transitivedescription:- name: open_filex- sha256: "9976da61b6a72302cf3b1efbce259200cd40232643a467aac7370addf94d6900"+ name: open_file+ sha256: "4f9b00d42565249ed4346976bc0d57f91303bec391f6b0b217921277cf8e6e4f"url: "https://pub.dev"source: hosted- version: "4.7.0"+ version: "4.0.0"+ open_file_android:+ dependency: transitive+ description:+ name: open_file_android+ sha256: f48a342b0347bf82bebf68c752f5cfce162965ce8449c5ecdafc406d294aa63d+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ open_file_ios:+ dependency: transitive+ description:+ name: open_file_ios+ sha256: "0e3e67dcd12f69888128f533cacc092039627dd4f1d7a95a2826b814ae4ea8aa"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ open_file_linux:+ dependency: transitive+ description:+ name: open_file_linux+ sha256: efd9c1f9679745cf35a54d21d809a1fe5a1196d4a1353fe2d205ba298ae86dc9+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ open_file_mac:+ dependency: transitive+ description:+ name: open_file_mac+ sha256: "1abe00e65f792b9baa1e15fdf4d44af5e813b1696ac307d71535543122a01e30"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ open_file_platform_interface:+ dependency: transitive+ description:+ name: open_file_platform_interface+ sha256: dc302e4bd5c1d77acec4240bd0dbc1d9f2ee6882b1ce52bca5298369da7acf12+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ open_file_web:+ dependency: transitive+ description:+ name: open_file_web+ sha256: "4945221c9ee98a5a6cdf26730fe0fabb3a36c1e423148bff4c32c283079ee532"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"+ open_file_windows:+ dependency: transitive+ description:+ name: open_file_windows+ sha256: "6a97d8f2a5966fb0a7f613a901f1d502f93456f64e8a7519d3204184413aab79"+ url: "https://pub.dev"+ source: hosted+ version: "1.1.0"package_config:dependency: transitivedescription: