transfer_kit 2.1.0+1
transfer_kit: ^2.1.0+1 copied to clipboard
A comprehensive file management solution for Flutter with Firebase Storage - upload, download, progress tracking, intelligent caching, background transfers, and beautiful UI widgets.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.1.0 - 2026-01-08 #
Added #
Enhanced Metadata Extraction
- PDF Thumbnail Extraction - Renders first page of PDF as thumbnail image
- Uses
pdfxpackage for native PDF rendering - Respects
autoExtractThumbnailconfiguration - Maintains aspect ratio with configurable max dimensions
- Uses
- Audio Waveform Extraction - Full waveform visualization support
- Uses
just_waveformpackage for waveform generation - Normalized amplitude samples (0.0 to 1.0)
- Configurable samples per second via
waveformSamplesPerSecond - New
autoExtractWaveformconfiguration option
- Uses
- Metadata Configuration Options - New settings in
FileManagementConfig:autoExtractMetadata- Enable/disable automatic metadata extractionautoExtractSha256- Enable/disable SHA-256 hash computationautoExtractThumbnail- Enable/disable thumbnail generationautoExtractWaveform- Enable/disable audio waveform extractionthumbnailMaxWidth/thumbnailMaxHeight- Thumbnail dimensionswaveformSamplesPerSecond- Waveform resolution
Changed #
Dependencies
- Replaced
lecle_flutter_carousel_prowithcarousel_slider(^5.0.0)- More popular and actively maintained
- Better API and customization options
- Added
autoPlayandautoPlayIntervalparameters toDownloadImageSliderWidget
- Updated
just_waveformto correct version ^0.0.7
Improvements
DownloadImageSliderWidgetconverted toStatefulWidgetfor proper indicator state- Custom dot indicators with active state tracking
- PDF metadata now includes thumbnail when enabled
2.0.0 - 2026-01-07 #
Added #
Centralized Configuration System
FileManagementConfig- New singleton class for library-wide configurationmaxConcurrentDownloads- Limit simultaneous downloads (default: 5)maxConcurrentUploads- Limit simultaneous uploads (default: 3)streamCleanupDelay- Delay before cleaning unused streams (default: 3s)enableLogging- Toggle debug loggingretryAttempts- Configure retry behaviorcacheEnabled/maxCacheSize/cacheExpiration- Cache settings
- Runtime configuration updates via setter methods
toMap()method for debugging configuration state
Stream Sharing Pattern
- Shared broadcast streams for download/upload operations
- Reference counting for automatic resource cleanup
- Delayed cleanup to prevent rapid stream re-creation during widget rebuilds
FirebaseStorageFactory.getDownloadStream()- Get or create shared download streamFirebaseStorageFactory.getUploadStream()- Get or create shared upload streamFirebaseStorageFactory.getActiveStreamStats()- Monitor stream sharing efficiency
Enhanced Exception System
FileException- New abstract base class with error chaining supportcauseproperty - Store original exception for debuggingstackTraceproperty - Preserve original stack traceFileCacheException- New exception for cache operationsFileTaskException- New exception for task operations
Media Metadata System
MediaMetadata- Comprehensive metadata class for all file types- Common: mimeType, fileSize, sha256, fileName, fileExtension, timestamps
- Images: width, height, aspectRatio, orientation, colorSpace, bitDepth
- Video/Audio: duration, frameRate, codecs, bitrate, sample rate
- Documents: pageCount, title, author, subject, keywords
- Custom: extensible customData map
WaveformData- Audio waveform visualization dataThumbnailData- Thumbnail storage for images/videos/documentsMetadataExtractionService- Automatic metadata extraction from local filesMetadataSourceenum - Track metadata origin (api, firebase, cache, local)- Metadata integrated into
FilePathAndURLfor seamless caching - Automatic metadata extraction on download/upload completion
- Metadata merging from multiple sources (API + local extraction)
Changed #
Performance Improvements
- O(n²) to O(n) optimization: Convert
Set.elementAt()loops toListindexing - Pre-computed filter conditions: Optimize
streamTasksBy()andgetTasksBy()methods - Immediate completion tracking: Replace
Future.delayedwith direct tracking - Stream sharing: Multiple subscribers share single Firebase listener
Code Quality
- Fixed typo:
RepositryāRepositoryacross all files (4 files renamed) - Unified comment language: All Arabic comments converted to English
- Unified UI text: All Arabic strings converted to English
- Enhanced documentation with comprehensive English comments
Security
- Added path traversal protection in
file_path_extension.dart - Validate file paths stay within app directory bounds
Bug Fixes
- Fixed
_filePathAndURLcache invalidation inFileTask - Improved
StreamControllerlifecycle management withonCancelcallbacks - Added
isClosedchecks before stream operations - Replaced custom
math.dartwith standarddart:math
Removed #
lib/src/core/extension/math.dart- Replaced withdart:math
Migration Notes #
Existing code continues to work without changes. New features are opt-in:
// Optional: Configure the library
FileManagementConfig.init(
maxConcurrentDownloads: 3,
enableLogging: true,
);
// New: Exception chaining
try {
await download();
} on FileDownloadException catch (e) {
print('Cause: ${e.cause}');
}
// New: Monitor stream efficiency
final stats = FirebaseStorageFactory.getActiveStreamStats();
// New: Pass metadata from API with download request
final task = await fileManager.downloadTask(
filePathAndUrl: FilePathAndURL.url(
url: imageUrl,
metadata: MediaMetadata(
mimeType: 'image/jpeg',
width: 1920,
height: 1080,
fileSize: 1024000,
),
),
taskId: 'download_001',
);
// After download, metadata is available and cached
final cachedFile = await fileManager.getCachedFile(imageUrl);
print('Dimensions: ${cachedFile?.metadata?.width}x${cachedFile?.metadata?.height}');
1.0.0 - 2024-01-07 #
Added #
- Initial release
FileManagementSystem- Main controller for file operationsFileTask- Task model with state managementFilePathAndURL- Path/URL handling model- File upload with progress tracking
- File download with progress tracking
- Batch operations (parallel/sequential)
- Task control (pause, resume, cancel, retry)
- Intelligent file caching
- Background transfer support
- UI Widgets:
FileLoadingCard- Download progress cardFileUploadCard- Upload progress cardFileTaskItem- Detailed task itemFileTaskCard- Compact task cardFileTaskTile- Task tile widgetMultiUploadProgressListView- Batch upload progressFileDownloadProgressListView- Batch download progress
- Media Widgets:
DownloadImageWidget- Image with automatic cachingDownloadVideoWidget- Video with thumbnail previewDownloadImageSliderWidget- Image carouselMediaDownloadCard- Generic media download cardDocumentDownloadCard- Document download card