diff --git a/LICENSE_THIRDPARTY.md b/LICENSE_THIRDPARTY.md index 336e0eb..f193b4e 100644 --- a/LICENSE_THIRDPARTY.md +++ b/LICENSE_THIRDPARTY.md @@ -728,32 +728,36 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ``` -## file_picker +## file_selector -[Pub](https://pub.dev/packages/file_picker) +[Pub](https://pub.dev/packages/file_selector) ```text -MIT License - -Copyright (c) 2018 Miguel Ruivo +Copyright 2013 The Flutter Authors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ``` ## device_info_plus diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 6fbdf3c..d8b38b9 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,39 +1,7 @@ PODS: - device_info_plus (0.0.1): - Flutter - - DKImagePickerController/Core (4.3.4): - - DKImagePickerController/ImageDataManager - - DKImagePickerController/Resource - - DKImagePickerController/ImageDataManager (4.3.4) - - DKImagePickerController/PhotoGallery (4.3.4): - - DKImagePickerController/Core - - DKPhotoGallery - - DKImagePickerController/Resource (4.3.4) - - DKPhotoGallery (0.0.17): - - DKPhotoGallery/Core (= 0.0.17) - - DKPhotoGallery/Model (= 0.0.17) - - DKPhotoGallery/Preview (= 0.0.17) - - DKPhotoGallery/Resource (= 0.0.17) - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Core (0.0.17): - - DKPhotoGallery/Model - - DKPhotoGallery/Preview - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Model (0.0.17): - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Preview (0.0.17): - - DKPhotoGallery/Model - - DKPhotoGallery/Resource - - SDWebImage - - SwiftyGif - - DKPhotoGallery/Resource (0.0.17): - - SDWebImage - - SwiftyGif - - file_picker (0.0.1): - - DKImagePickerController/PhotoGallery + - file_selector_ios (0.0.1): - Flutter - Flutter (1.0.0) - flutter_local_notifications (0.0.1): @@ -47,9 +15,6 @@ PODS: - path_provider_foundation (0.0.1): - Flutter - FlutterMacOS - - SDWebImage (5.15.5): - - SDWebImage/Core (= 5.15.5) - - SDWebImage/Core (5.15.5) - share_plus (0.0.1): - Flutter - shared_preferences_foundation (0.0.1): @@ -58,13 +23,12 @@ PODS: - sqflite_darwin (0.0.4): - Flutter - FlutterMacOS - - SwiftyGif (5.4.4) - url_launcher_ios (0.0.1): - Flutter DEPENDENCIES: - device_info_plus (from `.symlinks/plugins/device_info_plus/ios`) - - file_picker (from `.symlinks/plugins/file_picker/ios`) + - file_selector_ios (from `.symlinks/plugins/file_selector_ios/ios`) - Flutter (from `Flutter`) - flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`) - flutter_timezone (from `.symlinks/plugins/flutter_timezone/ios`) @@ -76,18 +40,11 @@ DEPENDENCIES: - sqflite_darwin (from `.symlinks/plugins/sqflite_darwin/darwin`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) -SPEC REPOS: - trunk: - - DKImagePickerController - - DKPhotoGallery - - SDWebImage - - SwiftyGif - EXTERNAL SOURCES: device_info_plus: :path: ".symlinks/plugins/device_info_plus/ios" - file_picker: - :path: ".symlinks/plugins/file_picker/ios" + file_selector_ios: + :path: ".symlinks/plugins/file_selector_ios/ios" Flutter: :path: Flutter flutter_local_notifications: @@ -111,20 +68,16 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: device_info_plus: bf2e3232933866d73fe290f2942f2156cdd10342 - DKImagePickerController: b512c28220a2b8ac7419f21c491fc8534b7601ac - DKPhotoGallery: fdfad5125a9fdda9cc57df834d49df790dbb4179 - file_picker: 09aa5ec1ab24135ccd7a1621c46c84134bfd6655 + file_selector_ios: f0670c1064a8c8450e38145d8043160105d0b97c Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086 flutter_timezone: ffb07bdad3c6276af8dada0f11978d8a1f8a20bb open_file_plus: 05737718530c14cf02868e3b7754d7fe4df76d8b package_info_plus: c0502532a26c7662a62a356cebe2692ec5fe4ec4 path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 - SDWebImage: fd7e1a22f00303e058058278639bf6196ee431fe share_plus: 8b6f8b3447e494cca5317c8c3073de39b3600d1f shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78 sqflite_darwin: 5a7236e3b501866c1c9befc6771dfd73ffb8702d - SwiftyGif: 93a1cc87bf3a51916001cf8f3d63835fb64c819f url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe PODFILE CHECKSUM: 38a5d5ec463a50cc13d7630ab79f450537b24db1 diff --git a/lib/view/common/xshare.dart b/lib/view/common/xshare.dart index dc6e257..54b17a1 100644 --- a/lib/view/common/xshare.dart +++ b/lib/view/common/xshare.dart @@ -14,23 +14,25 @@ import 'dart:io'; -import 'package:file_picker/file_picker.dart'; +import 'package:collection/collection.dart'; +import 'package:file_selector/file_selector.dart'; import 'package:flutter/material.dart'; import 'package:path/path.dart' as path; import 'package:share_plus/share_plus.dart'; -mixin XShare on State { +mixin XShare { Future shareXFiles(List files, {BuildContext? context, String? subject, String? text, List? fileNameOverrides}) async { if (Platform.isIOS) { - final box = (context ?? this.context).findRenderObject() as RenderBox?; + final box = context?.findRenderObject() as RenderBox?; return Share.shareXFiles(files, subject: subject, text: text, - sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size, + sharePositionOrigin: + box != null ? box.localToGlobal(Offset.zero) & box.size : null, fileNameOverrides: fileNameOverrides); } else { return Share.shareXFiles(files, @@ -38,14 +40,40 @@ mixin XShare on State { } } - Future pickAndSaveToFile(String savedFile, + Future saveSingleFile(String savedFile, {String? fileName, String? subject}) async { fileName ??= path.basename(savedFile); - final filePath = await FilePicker.platform - .saveFile(fileName: fileName, dialogTitle: subject); - if (filePath == null) return false; - final savedFileFp = File(savedFile); - if (!(await savedFileFp.exists())) return false; - return savedFileFp.copy(filePath).then((value) => value.exists()); + final saveLocation = await getSaveLocation(suggestedName: fileName); + if (saveLocation == null) return false; + final savedFileFp = XFile(savedFile); + await savedFileFp.saveTo(saveLocation.path); + return await File(saveLocation.path).exists(); } + + Future trySaveFiles(List files, TargetPlatform platform, + {BuildContext? context, + String? subject, + String? text, + List? fileNameOverrides}) => + switch (platform) { + TargetPlatform.android || TargetPlatform.iOS => shareXFiles(files, + context: context, + subject: subject, + text: text, + fileNameOverrides: fileNameOverrides) + .then((value) => value.status == ShareResultStatus.success), + TargetPlatform.windows || + TargetPlatform.macOS || + TargetPlatform.linux => + Future(() async { + for (final (i, e) in files.mapIndexed((i, e) => (i, e))) { + final r = await saveSingleFile(e.path, + fileName: fileNameOverrides?[i], subject: subject); + if (!r) return r; + } + return true; + }), + _ => throw UnimplementedError( + "trySaveFiles isn't implement on current platform: $platform"), + }; } diff --git a/lib/view/page_app_debugger.dart b/lib/view/page_app_debugger.dart index 8a8a8c0..dfcb6c0 100644 --- a/lib/view/page_app_debugger.dart +++ b/lib/view/page_app_debugger.dart @@ -87,14 +87,8 @@ class AppDebuggerViewState extends State with XShare { if (!context.mounted) return; if (!fileExist) return _showDebugLogFileDismissSnackbar(); final subject = L10n.of(context)?.debug_downladDebugLogs_subject; - switch (defaultTargetPlatform) { - case TargetPlatform.windows: - case TargetPlatform.macOS: - case TargetPlatform.linux: - pickAndSaveToFile(filePath, subject: subject); - default: - shareXFiles([XFile(filePath)], context: context, subject: subject); - } + trySaveFiles([XFile(filePath)], defaultTargetPlatform, + context: context, subject: subject); } void _onClearLogButtongPressed(BuildContext context) async { @@ -129,7 +123,7 @@ class AppDebuggerViewState extends State with XShare { await File(filePath).writeAsString(debugInfo, mode: FileMode.writeOnly); if (!context.mounted) return; final subject = L10n.of(context)?.debug_downladDebugInfo_subject; - pickAndSaveToFile(filePath, subject: subject); + saveSingleFile(filePath, subject: subject); } void _onFABPressed(BuildContext context) async { @@ -137,14 +131,8 @@ class AppDebuggerViewState extends State with XShare { if (!context.mounted) return; final subject = L10n.of(context)?.debug_downladDebugZip_subject(debuggerZipFile); - switch (defaultTargetPlatform) { - case TargetPlatform.windows: - case TargetPlatform.macOS: - case TargetPlatform.linux: - pickAndSaveToFile(zipFilePath, subject: subject); - default: - shareXFiles([XFile(zipFilePath)], context: context, subject: subject); - } + trySaveFiles([XFile(zipFilePath)], defaultTargetPlatform, + context: context, subject: subject); } void _showDebugLogFileDismissSnackbar() { diff --git a/lib/view/page_app_setting.dart b/lib/view/page_app_setting.dart index f626900..f41afd4 100644 --- a/lib/view/page_app_setting.dart +++ b/lib/view/page_app_setting.dart @@ -13,14 +13,12 @@ // limitations under the License. import 'dart:convert'; -import 'dart:io'; -import 'package:file_picker/file_picker.dart'; +import 'package:file_selector/file_selector.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:path/path.dart' as path; import 'package:provider/provider.dart'; -import 'package:share_plus/share_plus.dart'; import 'package:tuple/tuple.dart'; import '../common/consts.dart'; @@ -108,8 +106,7 @@ class AppSettingView extends StatefulWidget { State createState() => _AppSettingView(); } -class _AppSettingView extends State - with XShare { +class _AppSettingView extends State with XShare { @override void initState() { appLog.build.debug(context, ex: ["init"]); @@ -231,37 +228,31 @@ class _AppSettingView extends State ); if (!context.mounted || filePath == null) return; //TODO: add snackbar result - shareXFiles([XFile(filePath)], context: context); + trySaveFiles([XFile(filePath)], defaultTargetPlatform, context: context); } void _onImportAllTilePressed() async { - final FilePickerResult? result; if (!mounted) return; - try { - result = await FilePicker.platform.pickFiles(); - } on PlatformException catch (e) { + final XFile? file = + await openFile().timeout(const Duration(seconds: 5)).catchError((e, s) { appLog.load.error("$widget._onImportAllTilePressed", ex: ["Can't open file picker"], error: e, stackTrace: LoggerStackTrace.from(StackTrace.current)); - //TODO: add feedback - return; - } - - if (!mounted || result == null || result.files.single.path == null) return; - final file = File(result.files.single.path!); - - String rawJsonData = ''; - try { - rawJsonData = await file.readAsString(); - } on Exception catch (e) { - //TODO: add feedback + return null; + }); + + if (!mounted || file == null) return; + final String rawJsonData = await file + .readAsString() + .timeout(const Duration(seconds: 5)) + .catchError((e, s) { appLog.load.error("$widget._onImportAllTilePressed", ex: ["Can't read file", file], error: e, stackTrace: LoggerStackTrace.from(StackTrace.current)); - return; - } + return ''; + }); if (!mounted || rawJsonData.isEmpty) return; final Map jsonData = jsonDecode(rawJsonData); @@ -343,7 +334,7 @@ class _AppSettingView extends State final dbPath = path.join(await AppPathProvider().getDatabaseDirPath(), appDBName); if (!context.mounted) return; - shareXFiles([XFile(dbPath)], context: context); + trySaveFiles([XFile(dbPath)], defaultTargetPlatform, context: context); } void _onClearDBTilePressed(BuildContext context) async { @@ -361,10 +352,11 @@ class _AppSettingView extends State final dbPath = path.join(await AppPathProvider().getDatabaseDirPath(), appDBName); if (!context.mounted) return; - final result = await shareXFiles( - [if (filePath != null) XFile(filePath), XFile(dbPath)], - context: context); - if (result.status == ShareResultStatus.success) { + final result = await trySaveFiles([ + if (filePath != null) XFile(filePath), + XFile(dbPath) + ], defaultTargetPlatform, context: context); + if (result) { break; } else { if (!context.mounted) return; diff --git a/lib/view/page_habit_detail.dart b/lib/view/page_habit_detail.dart index 0efc20c..8aedf09 100644 --- a/lib/view/page_habit_detail.dart +++ b/lib/view/page_habit_detail.dart @@ -117,9 +117,7 @@ class HabitDetailView extends StatefulWidget { } class _HabitDetailView extends State - with - HabitHeatmapColorChooseMixin, - XShare { + with HabitHeatmapColorChooseMixin, XShare { @override void initState() { appLog.build.debug(context, ex: ["init"]); @@ -352,7 +350,8 @@ class _HabitDetailView extends State ); if (!context.mounted || filePath == null) return; //TODO: add snackbar result - shareXFiles([XFile(filePath)], text: "Export Habit", context: context); + trySaveFiles([XFile(filePath)], defaultTargetPlatform, + context: context, text: 'Export Habit'); } Widget _buildDebugInfo(BuildContext context) { diff --git a/lib/view/page_habits_display.dart b/lib/view/page_habits_display.dart index 542461c..1f1d182 100644 --- a/lib/view/page_habits_display.dart +++ b/lib/view/page_habits_display.dart @@ -93,7 +93,7 @@ class HabitsDisplayView extends StatefulWidget { } class _HabitsDisplayView extends State - with HabitsDisplayViewDebug, XShare { + with HabitsDisplayViewDebug, XShare { @override void initState() { appLog.build.debug(context, ex: ["init"]); @@ -432,7 +432,7 @@ class _HabitsDisplayView extends State if (!context.mounted || filePath == null) return; context.read().exitEditMode(); //TODO: add snackbar result - shareXFiles([XFile(filePath)], + trySaveFiles([XFile(filePath)], defaultTargetPlatform, text: "Export Select Habits", context: context); } @@ -528,8 +528,8 @@ class _HabitsDisplayView extends State void _onAppbarSelectAllActionPressed() => context.read().selectAllHabit(); - void _onAppbarExportAllActionPressed() => - _exportSelectedHabitsAndShared(context); + void _onAppbarExportAllActionPressed(BuildContext? context) => + _exportSelectedHabitsAndShared(context ?? this.context); void _onAppbarDeleteActionPressed() => _openHabitDeleteConfirmDialog(context); @@ -862,7 +862,7 @@ class _HabitsDisplayView extends State callback: _onAppbarCloneActionPressed), EditModeActionItemConfig.exportall( text: l10n?.habitDisplay_editPopMenu_export ?? "Export", - callback: _onAppbarExportAllActionPressed), + callback: () => _onAppbarExportAllActionPressed(context)), EditModeActionItemConfig.delete( text: l10n?.habitDisplay_editPopMenu_delete ?? 'Delete', callback: _onAppbarDeleteActionPressed), diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 92f4e45..bed70b4 100644 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -7,6 +7,7 @@ #include "generated_plugin_registrant.h" #include +#include #include #include @@ -14,6 +15,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) dynamic_color_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "DynamicColorPlugin"); dynamic_color_plugin_register_with_registrar(dynamic_color_registrar); + g_autoptr(FlPluginRegistrar) file_selector_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin"); + file_selector_plugin_register_with_registrar(file_selector_linux_registrar); g_autoptr(FlPluginRegistrar) flutter_timezone_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterTimezonePlugin"); flutter_timezone_plugin_register_with_registrar(flutter_timezone_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 41a0878..b7bddc5 100644 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST dynamic_color + file_selector_linux flutter_timezone url_launcher_linux ) diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index 03ce5fc..c2e7b61 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -7,6 +7,7 @@ import Foundation import device_info_plus import dynamic_color +import file_selector_macos import flutter_local_notifications import flutter_timezone import package_info_plus @@ -19,6 +20,7 @@ import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin")) + FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) FlutterLocalNotificationsPlugin.register(with: registry.registrar(forPlugin: "FlutterLocalNotificationsPlugin")) FlutterTimezonePlugin.register(with: registry.registrar(forPlugin: "FlutterTimezonePlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) diff --git a/macos/Podfile.lock b/macos/Podfile.lock index ccf51bd..a443548 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -3,6 +3,8 @@ PODS: - FlutterMacOS - dynamic_color (0.0.2): - FlutterMacOS + - file_selector_macos (0.0.1): + - FlutterMacOS - flutter_local_notifications (0.0.1): - FlutterMacOS - flutter_timezone (0.1.0): @@ -27,6 +29,7 @@ PODS: DEPENDENCIES: - device_info_plus (from `Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos`) - dynamic_color (from `Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos`) + - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`) - flutter_local_notifications (from `Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos`) - flutter_timezone (from `Flutter/ephemeral/.symlinks/plugins/flutter_timezone/macos`) - FlutterMacOS (from `Flutter/ephemeral`) @@ -42,6 +45,8 @@ EXTERNAL SOURCES: :path: Flutter/ephemeral/.symlinks/plugins/device_info_plus/macos dynamic_color: :path: Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos + file_selector_macos: + :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos flutter_local_notifications: :path: Flutter/ephemeral/.symlinks/plugins/flutter_local_notifications/macos flutter_timezone: @@ -64,6 +69,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: device_info_plus: 1b14eed9bf95428983aed283a8d51cce3d8c4215 dynamic_color: 2eaa27267de1ca20d879fbd6e01259773fb1670f + file_selector_macos: cc3858c981fe6889f364731200d6232dac1d812d flutter_local_notifications: 4b427ffabf278fc6ea9484c97505e231166927a5 flutter_timezone: 6b906d1740654acb16e50b639835628fea851037 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements index dddb8a3..d138bd5 100644 --- a/macos/Runner/DebugProfile.entitlements +++ b/macos/Runner/DebugProfile.entitlements @@ -8,5 +8,7 @@ com.apple.security.network.server + com.apple.security.files.user-selected.read-write + diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements index 852fa1a..19afff1 100644 --- a/macos/Runner/Release.entitlements +++ b/macos/Runner/Release.entitlements @@ -4,5 +4,7 @@ com.apple.security.app-sandbox + com.apple.security.files.user-selected.read-write + diff --git a/pubspec.lock b/pubspec.lock index daa8f69..0e1490a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -358,14 +358,70 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.1" - file_picker: + file_selector: dependency: "direct main" description: - name: file_picker - sha256: c904b4ab56d53385563c7c39d8e9fa9af086f91495dfc48717ad84a42c3cf204 + name: file_selector + sha256: "5019692b593455127794d5718304ff1ae15447dea286cdda9f0db2a796a1b828" url: "https://pub.dev" source: hosted - version: "8.1.7" + version: "1.0.3" + file_selector_android: + dependency: transitive + description: + name: file_selector_android + sha256: "98ac58e878b05ea2fdb204e7f4fc4978d90406c9881874f901428e01d3b18fbc" + url: "https://pub.dev" + source: hosted + version: "0.5.1+12" + file_selector_ios: + dependency: transitive + description: + name: file_selector_ios + sha256: "94b98ad950b8d40d96fee8fa88640c2e4bd8afcdd4817993bd04e20310f45420" + url: "https://pub.dev" + source: hosted + version: "0.5.3+1" + file_selector_linux: + dependency: transitive + description: + name: file_selector_linux + sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" + url: "https://pub.dev" + source: hosted + version: "0.9.3+2" + file_selector_macos: + dependency: transitive + description: + name: file_selector_macos + sha256: "271ab9986df0c135d45c3cdb6bd0faa5db6f4976d3e4b437cf7d0f258d941bfc" + url: "https://pub.dev" + source: hosted + version: "0.9.4+2" + file_selector_platform_interface: + dependency: transitive + description: + name: file_selector_platform_interface + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b + url: "https://pub.dev" + source: hosted + version: "2.6.2" + file_selector_web: + dependency: transitive + description: + name: file_selector_web + sha256: c4c0ea4224d97a60a7067eca0c8fd419e708ff830e0c83b11a48faf566cec3e7 + url: "https://pub.dev" + source: hosted + version: "0.9.4+2" + file_selector_windows: + dependency: transitive + description: + name: file_selector_windows + sha256: "8f5d2f6590d51ecd9179ba39c64f722edc15226cc93dcc8698466ad36a4a85a4" + url: "https://pub.dev" + source: hosted + version: "0.9.3+3" fixnum: dependency: transitive description: @@ -480,14 +536,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.7.4+3" - flutter_plugin_android_lifecycle: - dependency: transitive - description: - name: flutter_plugin_android_lifecycle - sha256: "615a505aef59b151b46bbeef55b36ce2b6ed299d160c51d84281946f0aa0ce0e" - url: "https://pub.dev" - source: hosted - version: "2.0.24" flutter_svg: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index aedb5cc..824870a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -50,7 +50,7 @@ dependencies: linked_scroll_controller: ^0.2.0 sliver_tools: ^0.2.9 share_plus: ^10.0.0 - file_picker: ^8.0.5 + file_selector: ^1.0.3 path_provider: ^2.0.14 device_info_plus: ^11.2.0 flutter_local_notifications: ^17.2.3 diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 6cbfdb1..b83003e 100644 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,6 +7,7 @@ #include "generated_plugin_registrant.h" #include +#include #include #include #include @@ -14,6 +15,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { DynamicColorPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); + FileSelectorWindowsRegisterWithRegistrar( + registry->GetRegistrarForPlugin("FileSelectorWindows")); FlutterTimezonePluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("FlutterTimezonePluginCApi")); SharePlusWindowsPluginCApiRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index e8abb09..af940c3 100644 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,6 +4,7 @@ list(APPEND FLUTTER_PLUGIN_LIST dynamic_color + file_selector_windows flutter_timezone share_plus url_launcher_windows