downloadsfolder 2.0.0-pre.2
downloadsfolder: ^2.0.0-pre.2 copied to clipboard
A Flutter plugin for retrieving the path to the downloads folder and performing operations related to file downloads on different platforms.
2.0.0-pre.2 #
Breaking Changes
copyFileIntoDownloadFoldernow returnsFuture<SavedDownload?>instead ofFuture<File?>.SavedDownloadexposes bothfile(the on-disk path) andcontentUri(the AndroidMediaStorecontent://URI on Android 10+,nullelsewhere). UsecontentUrifor any read / share / intent work on Android 10+ — scoped storage prevents rawdart:ioaccess tofile.pathfrom the calling app even though the file exists. Migration: replacesaved.pathwithsaved.file.path.- Minimum Flutter SDK bumped to 3.44.0 (Dart
^3.12.0). Required for the Android Built-in Kotlin migration. - Android plugin migrated to Built-in Kotlin. The plugin no longer applies the Kotlin Gradle Plugin (
kotlin-android). Consumer apps that have not yet migrated to Built-in Kotlin should follow https://docs.flutter.dev/release/breaking-changes/migrate-to-built-in-kotlin/for-app-developers. - iOS plugin now ships a Swift Package Manager manifest at
ios/downloadsfolder/Package.swift. The CocoaPods podspec is preserved for apps that have not yet adopted SPM. - macOS plugin now ships a Swift Package Manager manifest at
macos/downloadsfolder/Package.swift. The CocoaPods podspec is preserved for apps that have not yet adopted SPM.
New Features
openAfterSaveparameter oncopyFileIntoDownloadFolder. Whentrue, the saved file is immediately opened in the OS default viewer (ACTION_VIEWon Android,open/xdg-open/cmd /c starton the desktop platforms).
Bug Fixes
- iOS
openDownloadFolderno longer hangs. The Swift handler now invokes the Flutter result callback viaUIApplication.shared.open(_:options:completionHandler:)so the Dart future resolves totrue/falsecorrectly. - Android
copyFileIntoDownloadFolderno longer throws on Android 10+. The native MediaStore helper now resolves the on-disk path by queryingDISPLAY_NAME+RELATIVE_PATH(the deprecatedDATAcolumn returnednullon R+), includes the file extension in the saved file's display name, and sanitizes thesubDirectoryPath. The Dart side no longer force-unwraps the platform-channel result. copyFileIntoDownloadFoldernow correctly creates nestedsubDirectoryPathdirectories on the non-MediaStore path (Android < 29, iOS, desktop).FileTool.copyTopreviously calledDirectory.create()non-recursively and threwPathNotFoundExceptionwhen the immediate parent did not exist.
Example app
- Added a subdirectory text field and an "Open file after save" toggle so the new
subDirectoryPath/openAfterSaveknobs can be exercised from the UI.
Internal
- Dropped the unused
dartxdependency. - Documentation updated to reflect the new return type and scoped-storage behaviour.
- Replaced obsolete
getPlatformVersionKotlin/Windows/example tests with assertions that match the current plugin surface, and added Dart unit tests coveringSavedDownload,FileTool.copyTo(collision suffixing, sanitization, diacritic stripping, extension handling), and the method-channel layer (channel name, off-Android short-circuit, native call shape, and the non-Android copy branch with a mockedpath_provider). - Added a GitHub Actions workflow (.github/workflows/ci.yml) that on every push/PR runs
dart format --set-exit-if-changed,flutter analyze, andflutter testfor both the plugin and the example, plus an Android APK build with Kotlin Gradle unit tests, an iOS simulator build, and a macOS build. - Podspec metadata corrected (homepage, summary, author, version); iOS platform aligned with README at
12.0.
2.0.0-pre.1 #
1.2.0 #
- Breaking Change:
- Removed the dependency on
permission_handler. - This plugin no longer manages write permissions.
- Action Required: You must implement write permission handling in your app manually.
- Removed the dependency on
- [Android] Upgraded the required Android Java version to 17.
- Fixed Flutter 3.27.0 warning for the Linux platform
1.1.1 #
- Updated dependencies to the latest versions.
- Restored the Linux platform tag on pub.dev.
1.1.0 #
- Implemented more concise and maintainable code organization.
- Reduced duplication by introducing helper methods for platform-specific operations.
- Improved error handling with specific error messages.
- Enhanced platform detection for better compatibility.
- Separated concerns for copying files and opening the download folder.
- Utilized asynchronous operations more efficiently for cleaner code.
- Improved consistency in naming conventions and the use of constants.
- Fixed platform-specific issues related to directory retrieval and opening the download folder.
- Fixed error handling to provide more informative error messages.
- Refactored code to adhere to Dart and Flutter best practices.
- Updated dependencies to the latest versions.
- Removed dependencies on path_provider_windows and path_provider_linux for improved simplicity and reduced overhead.
1.1.0-pre-release #
- remove the usage of url_launcher plugin
- Fix (Desktop) Copy the default file extension if desiredExtension is not provided.
1.0.1 #
- Updates documentation on README.md.
- Fix linux compilation (#3)
- Fix openDownloadFolder not working on Linux.
1.0.0 #
- remove the usage of device_info_plus plugin
- BREAKING Bump compileSdkVersion to 34 in Gradle buildscripts
- BREAKING Change getDownloadFolderPath to getDownloadFolder and have it return a Directory instead of a String?
- FIX openDownloadFolder not working with MacOs
- Update dependencies
0.1.1 #
- update dependencies
- update example app
0.0.5 Initial Release #
- Released the initial version of the
downloadsfolderplugin. - Added functionality to retrieve the path to the downloads folder based on the platform.
- Implemented the ability to copy files into the downloads folder, ensuring unique names to avoid overwriting existing files.
- Provided the option to open the downloads folder on the device's file system.