flutter_ios_folder_picker
A Flutter plugin to pick a folder on iOS.
Note: This plugin currently only supports iOS.
🚀 Features
- Open native iOS folder picker
- Return the selected folder path
- Singleton instance for easy access
📦 Installation
Add this to your pubspec.yaml
:
dependencies:
flutter_ios_folder_picker:
git:
url: https://github.com/your-repo/flutter_ios_folder_picker.git
🔧 iOS Setup
In your ios/Runner/Info.plist
, add the following:
<key>UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>
<key>NSDocumentPickerUsageDescription</key>
<string>This app needs folder access to read files.</string>
🛠️ Usage
Import the package:
import 'package:flutter_ios_folder_picker/flutter_ios_folder_picker.dart';
Pick a folder:
final folderPicker = FlutterIosFolderPicker();
String? folderPath = await folderPicker.pickFolder();
if (folderPath != null) {
print('Selected folder: $folderPath');
} else {
print('No folder selected.');
}
📋 Example
ElevatedButton(
onPressed: () async {
final folderPath = await FlutterIosFolderPicker().pickFolder();
if (folderPath != null) {
print('Folder picked: $folderPath');
}
},
child: Text('Pick Folder'),
)
⚠️ Limitations
- Only works on iOS 14+.
- Not available for Android.
📄 License
MIT License.
Made with ❤️ by mxgk