File Share Adapter
Component Detail
Infrastructure
low complexity
Shared Component
mobile
0
Dependencies
1
Dependents
0
Entities
0
Integrations
Description
Abstracts the Flutter platform-specific file delivery mechanisms. On download, uses the `path_provider` package to write the export file to the device's documents directory and the `share_plus` package to open the native platform share sheet, allowing the user to save locally, email to Bufdir, or open in another app. Decouples the Report Export Service from direct Flutter plugin calls.
file-share-adapter
Responsibilities
- Write received file bytes to a temporary or documents directory path via path_provider
- Open the native share sheet with the file via share_plus
- Clean up temporary files after sharing completes
- Handle platform permission errors for file system access
Interfaces
shareFile(fileBytes, fileName, mimeType)
saveToDocuments(fileBytes, fileName)
getTempFilePath(fileName)
deleteFile(filePath)
getFileSize(filePath)