diff --git a/desktop/lib/platform.dart b/desktop/lib/platform.dart index d5c985f..54c337c 100644 --- a/desktop/lib/platform.dart +++ b/desktop/lib/platform.dart @@ -1,21 +1,13 @@ import 'dart:io'; -import 'package:file_chooser/file_chooser.dart'; +import 'package:file_picker/file_picker.dart'; import 'package:musicus_common/musicus_common.dart'; import 'package:path/path.dart' as p; class MusicusDesktopPlatform extends MusicusPlatform { @override Future chooseBasePath() async { - final result = await showOpenPanel( - canSelectDirectories: true, - ); - - if (result != null && !result.canceled) { - return result.paths.first; - } else { - return null; - } + return await FilePicker.platform.getDirectoryPath(); } @override diff --git a/desktop/linux/flutter/CMakeLists.txt b/desktop/linux/flutter/CMakeLists.txt index 94f43ff..33fd580 100644 --- a/desktop/linux/flutter/CMakeLists.txt +++ b/desktop/linux/flutter/CMakeLists.txt @@ -78,7 +78,8 @@ add_custom_command( COMMAND ${CMAKE_COMMAND} -E env ${FLUTTER_TOOL_ENVIRONMENT} "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" - linux-x64 ${CMAKE_BUILD_TYPE} + ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} + VERBATIM ) add_custom_target(flutter_assemble DEPENDS "${FLUTTER_LIBRARY}" diff --git a/desktop/linux/flutter/generated_plugin_registrant.cc b/desktop/linux/flutter/generated_plugin_registrant.cc index b044cbd..f6f23bf 100644 --- a/desktop/linux/flutter/generated_plugin_registrant.cc +++ b/desktop/linux/flutter/generated_plugin_registrant.cc @@ -2,15 +2,13 @@ // Generated file. Do not edit. // +// clang-format off + #include "generated_plugin_registrant.h" -#include #include void fl_register_plugins(FlPluginRegistry* registry) { - g_autoptr(FlPluginRegistrar) file_chooser_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "FileChooserPlugin"); - file_chooser_plugin_register_with_registrar(file_chooser_registrar); g_autoptr(FlPluginRegistrar) url_launcher_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "UrlLauncherPlugin"); url_launcher_plugin_register_with_registrar(url_launcher_linux_registrar); diff --git a/desktop/linux/flutter/generated_plugin_registrant.h b/desktop/linux/flutter/generated_plugin_registrant.h index 9bf7478..e0f0a47 100644 --- a/desktop/linux/flutter/generated_plugin_registrant.h +++ b/desktop/linux/flutter/generated_plugin_registrant.h @@ -2,6 +2,8 @@ // Generated file. Do not edit. // +// clang-format off + #ifndef GENERATED_PLUGIN_REGISTRANT_ #define GENERATED_PLUGIN_REGISTRANT_ diff --git a/desktop/linux/flutter/generated_plugins.cmake b/desktop/linux/flutter/generated_plugins.cmake index 6a174de..1fc8ed3 100644 --- a/desktop/linux/flutter/generated_plugins.cmake +++ b/desktop/linux/flutter/generated_plugins.cmake @@ -3,7 +3,6 @@ # list(APPEND FLUTTER_PLUGIN_LIST - file_chooser url_launcher_linux ) diff --git a/desktop/pubspec.yaml b/desktop/pubspec.yaml index ce3336a..d1b0eeb 100644 --- a/desktop/pubspec.yaml +++ b/desktop/pubspec.yaml @@ -6,11 +6,7 @@ environment: sdk: ">=2.3.0 <3.0.0" dependencies: - file_chooser: - git: - url: git://github.com/google/flutter-desktop-embedding.git - path: plugins/file_chooser - ref: bd722fbdb6d491d4b7781c240543ed3b3b181063 + file_picker: ^4.5.1 flutter: sdk: flutter musicus_common: