From 6aac7e7a1386a0ab4c1f9d29fe74cb3485709dcd Mon Sep 17 00:00:00 2001 From: Thomas Verbeek Date: Fri, 26 Jun 2020 09:19:43 +0200 Subject: [PATCH] path provider now supports download directory on windows --- .../path_provider_fde/windows/path_provider_plugin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugins/flutter_plugins/path_provider_fde/windows/path_provider_plugin.cpp b/plugins/flutter_plugins/path_provider_fde/windows/path_provider_plugin.cpp index a5432d13d..4542beaf1 100644 --- a/plugins/flutter_plugins/path_provider_fde/windows/path_provider_plugin.cpp +++ b/plugins/flutter_plugins/path_provider_fde/windows/path_provider_plugin.cpp @@ -148,6 +148,15 @@ void PathProviderPlugin::HandleMethodCall( } flutter::EncodableValue response(path); result->Success(&response); + } else if (method_call.method_name().compare( + "getDownloadsDirectory") == 0) { + std::string path = GetFolderPath(FOLDERID_Downloads); + if (path.empty()) { + result->Error("Unable to get downloads path"); + return; + } + flutter::EncodableValue response(path); + result->Success(&response); } else { result->NotImplemented(); }