From b3576d4b4981c7e1bdb0194ae7ff5081a982592a Mon Sep 17 00:00:00 2001 From: Fabian Freund Date: Thu, 16 Apr 2026 05:33:17 +0200 Subject: [PATCH] file picker use static methods --- .../bookmarks/presentation/screens/bookmark_list.dart | 4 ++-- .../presentation/dialogs/install_local_addon_dialog.dart | 2 +- .../browser/presentation/widgets/browser_menu_sheet.dart | 2 +- .../features/browser/presentation/widgets/tab_menu.dart | 6 ++++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/weblibre/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart b/apps/weblibre/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart index cbc83134..13d2c2a7 100644 --- a/apps/weblibre/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart +++ b/apps/weblibre/lib/features/geckoview/features/bookmarks/presentation/screens/bookmark_list.dart @@ -998,7 +998,7 @@ class BookmarkListScreen extends HookConsumerWidget { String format, ) async { try { - final result = await FilePicker.platform.pickFiles( + final result = await FilePicker.pickFiles( type: FileType.custom, allowedExtensions: format == 'json' ? ['json'] : ['html', 'htm'], ); @@ -1066,7 +1066,7 @@ class BookmarkListScreen extends HookConsumerWidget { final defaultFileName = 'bookmarks_$timestamp.${format == 'json' ? 'json' : 'html'}'; - final outputPath = await FilePicker.platform.saveFile( + final outputPath = await FilePicker.saveFile( dialogTitle: 'Export Bookmarks', fileName: defaultFileName, type: FileType.custom, diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/dialogs/install_local_addon_dialog.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/dialogs/install_local_addon_dialog.dart index 01c58f5f..749dfc30 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/dialogs/install_local_addon_dialog.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/dialogs/install_local_addon_dialog.dart @@ -45,7 +45,7 @@ class _InstallLocalAddonSheet extends HookConsumerWidget { Future pickFile() async { try { - final result = await FilePicker.platform.pickFiles(); + final result = await FilePicker.pickFiles(); if (result != null && result.files.isNotEmpty) { final path = result.files.single.path; diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_menu_sheet.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_menu_sheet.dart index 5b198859..3cf6f324 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_menu_sheet.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/browser_menu_sheet.dart @@ -1605,7 +1605,7 @@ class _ExportExpansion extends ConsumerWidget { content, fileName, ) async { - await FilePicker.platform.saveFile( + await FilePicker.saveFile( fileName: fileName, type: FileType.custom, allowedExtensions: ['md'], diff --git a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart index 0158a0ef..2de6b2f5 100644 --- a/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart +++ b/apps/weblibre/lib/features/geckoview/features/browser/presentation/widgets/tab_menu.dart @@ -211,7 +211,9 @@ class TabMenu extends HookConsumerWidget { Consumer( builder: (context, ref, child) { final isInstallable = ref.watch(isCurrentTabInstallableProvider); - final isShortcutable = ref.watch(isCurrentTabShortcutableProvider); + final isShortcutable = ref.watch( + isCurrentTabShortcutableProvider, + ); return Visibility( visible: isInstallable || isShortcutable, @@ -575,7 +577,7 @@ class TabMenu extends HookConsumerWidget { // ignore: deprecated_member_use icon: const Icon(MdiIcons.languageMarkdown), shareMarkdownAction: (content, fileName) async { - await FilePicker.platform.saveFile( + await FilePicker.saveFile( fileName: fileName, type: FileType.custom, allowedExtensions: ['md'],