{"id":18308691,"url":"https://github.com/ardriveapp/ardrive_io","last_synced_at":"2025-04-12T17:12:39.898Z","repository":{"id":97740403,"uuid":"578610663","full_name":"ardriveapp/ardrive_io","owner":"ardriveapp","description":"Custom library to perform I/O operations for ArDrive Web","archived":false,"fork":false,"pushed_at":"2025-01-08T18:18:47.000Z","size":129,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T17:12:31.315Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ardriveapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-15T13:15:19.000Z","updated_at":"2024-11-18T19:42:33.000Z","dependencies_parsed_at":"2024-01-04T18:24:28.917Z","dependency_job_id":"18894621-609d-492c-8646-3ad2fb16829a","html_url":"https://github.com/ardriveapp/ardrive_io","commit_stats":null,"previous_names":["ardriveapp/ardrive_io"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardriveapp%2Fardrive_io","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardriveapp%2Fardrive_io/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardriveapp%2Fardrive_io/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ardriveapp%2Fardrive_io/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ardriveapp","download_url":"https://codeload.github.com/ardriveapp/ardrive_io/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248602312,"owners_count":21131616,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T16:08:58.338Z","updated_at":"2025-04-12T17:12:39.878Z","avatar_url":"https://github.com/ardriveapp.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ArDriveIO\n\nCustom library to perform I/O operations for ArDrive Web\n\n## Features\n\nThe following methods perform the I/O operations supported in this package:\n\n### Pick a folder, a file or multiple files from the native storage\n\n- pickFile()\n- pickFiles()\n- pickFolder()\n\n### Save a file to the native storage\n\n- saveFile()\n\n## Getting started\n\nIn order to use this package you must follow these instructions:\n\n### Android\n\nFor pickFile(s) or folders nothing is required, but is worth to read the [file_picker Setup](https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#--android).\n\nAdd those permissions to AndroidManifest\n\n```xml\n    \u003cuses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/\u003e\n    \u003cuses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/\u003e\n```\n\n### iOS\n\nIt's important to check the complete setup for using file_picker library at (setup iOS)[https://github.com/miguelpruivo/flutter_file_picker/wiki/Setup#ios]. Most of the information here is from file_picker documentation.\n\nThese Settings are optional for iOS, as in iOS the file will be saved in application documents directory but will not be visible in Files application, to make your file visible in iOS Files application, make the changes mentioned below.\niOS:\n\nGo to your project folder, ios/Runner/info.plist and Add these keys:\n\nBased on the location of the files that you are willing to pick paths, you may need to add some keys to your iOS app's Info.plist file, located in \u003cproject root\u003e/ios/Runner/Info.plist:\n\n#### UIBackgroundModes with the fetch and remote-notifications keys\n\nRequired if you'll be using the FileType.any or FileType.custom. Describe why your app needs to access background taks, such downloading files (from cloud services). This is called Required background modes, with the keys App download content from network and App downloads content in response to push notifications respectively in the visual editor (since both methods aren't actually overriden, not adding this property/keys may only display a warning, but shouldn't prevent its correct usage).\n\n```xml\n\u003ckey\u003eUIBackgroundModes\u003c/key\u003e\n\u003carray\u003e\n   \u003cstring\u003efetch\u003c/string\u003e\n   \u003cstring\u003eremote-notification\u003c/string\u003e\n\u003c/array\u003e\n```\n\n#### NSAppleMusicUsageDescription\n\nRequired if you'll be using the FileType.audio. Describe why your app needs permission to access music library. This is called Privacy - Media Library Usage Description in the visual editor.\n\n```xml\n\u003ckey\u003eNSAppleMusicUsageDescription\u003c/key\u003e\n\u003cstring\u003eExplain why your app uses music\u003c/string\u003e\n```\n\n#### LSSupportsOpeningDocumentsInPlace\n\nRequired\n\n```xml\n\u003ckey\u003eLSSupportsOpeningDocumentsInPlace\u003c/key\u003e\n\u003ctrue/\u003e\n```\n\n#### UISupportsDocumentBrowser\n\nRequired if you'll want to write directly on directories. This way iOS creates an app folder for the app and the user can create and pick directories within the folder and the app has the permission to write here.\n\n```xml\n\u003ckey\u003eUISupportsDocumentBrowser\u003c/key\u003e\n\u003ctrue/\u003e\n```\n\n#### NSPhotoLibraryUsageDescription\n\nRequired if you'll be using the FileType.image or FileType.video. Describe why your app needs permission for the photo library. This is called Privacy - Photo Library Usage Description in the visual editor.\n\n```xml\n\u003ckey\u003eNSPhotoLibraryUsageDescription\u003c/key\u003e\n\u003cstring\u003eExplain why your app uses photo library\u003c/string\u003e\n```\n\n#### UIFileSharingEnabled\n\nRequired to use the `save` method on iOS\n\n```xml\n\u003ckey\u003eUIFileSharingEnabled\u003c/key\u003e\n\u003ctrue/\u003e\n```\n\n### Web\n\nTODO:\n\n## Usage\n\nAn example application is provided at `/example` folder.\n\nIt's easy to pick a file. It will opens the native file picker and returns an `IOFile`.\n\n```dart\nfinal arDriveIO = ArDriveIO();\n\nfinal file = await arDriveIO.pickFile();\n```\n\nIt's possible to filter the files by using the `allowedExtensions` parameter\n\n```dart\nfinal arDriveIO = ArDriveIO();\n\nfinal file = await arDriveIO.pickFile(allowedExtensions: ['json']);\n```\n\nTo pick a folder you just need to call the `pickFolder()` function\n\n```dart\nfinal arDriveIO = ArDriveIO();\n\nfinal folder = await arDriveIO.pickFolder();\n\n```\n\nTo get its content, call `listContent()`. It will recursively mount the folder hierarchy and return the folder structure as a tree of `IOEntity`s.\n\n```dart\nfinal arDriveIO = ArDriveIO();\n\nfinal folder = await arDriveIO.pickFolder();\nfinal files = await folder.listContent();\n```\n\nIt's possible to list all files and folders without handling the complexity of getting it recursively with the methods\n`listFiles()` and `listSubfolders()`:\n\n```dart\n\nfinal arDriveIO = ArDriveIO();\n\nfinal folder = await arDriveIO.pickFolder();\n/// A list of all files inside this folder\nfinal files = await folder.listFiles();\n/// A list of all subfolders\nfinal subfolders = await folder.listSubfolders();\n```\n\n## Additional information\n\n### IOFile\n\nBase class representing a local File\n\n### IOFolder\n\nBase class represeting a local Directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardriveapp%2Fardrive_io","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fardriveapp%2Fardrive_io","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fardriveapp%2Fardrive_io/lists"}