एक फ्लटर पैकेज जो रिज़मी, प्रगति ट्रैकिंग और क्यू मैनेजमेंट के साथ चंक्ड फाइल अपलोड के लिए है। बड़े फाइलों के लिए पासिव स्टोरेज, पॉज़, रिज़मी और कैंसिल का समर्थन करता है।
सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।
एक फ्लटर पैकेज जो बड़े फ़ाइलों को टुकड़ों में अपलोड करने के लिए डिज़ाइन किया गया है, जिसमें रिज़ूम क्षमता, रियल-टाइम प्रगति ट्रैकिंग और कुशल कतार प्रबंधन शामिल है। इसमें अपलोड को रोकना, जारी रखना और रद्द करने के ऑपरेशन सपोर्ट करता है, और ऐप रिस्टार्ट के बाद भी अपलोड स्टेट को बनाए रखने के लिए पर्मानेंट स्टोरेज है। एंड्रॉइड, आईओएस, मैकओएस, विंडोज और लिनक्स जैसे कई प्लेटफॉर्म पर बड़े फ़ाइल ट्रांसफर को विश्वसनीय ढंग से हैंडल करने के लिए आदर्श है।
उपयोग
बड़े वीडियो फ़ाइल अपलोड करना
बाधित अपलोड को पुनर्निर्माण करना
एक लंबित कतार में कई फ़ाइल अपलोड का प्रबंधन करना
अस्थिर नेटवर्क कनेक्शन का प्रबंधन
ऑफलाइन-प्रथम फ़ाइल ट्रांसफर वर्कफ़्लो
मुख्य विशेषताएँ
चंक्ड फ़ाइल अपलोड समर्थन
अपलोड बाधित करें
रियल-टाइम प्रगति ट्रैकिंग
रोकें और जारी रखें कार्यक्षमता
स्थायी अपलोड स्टेट स्टोरेज
प्लेटफॉर्म के अनुकूलता
इनके लिए उपयुक्त
बड़े फ़ाइल अपलोड की आवश्यकता वाले ऐप्स
नेटवर्क-तीव्र एप्लिकेशन
ऑफलाइन-क्षम डेटा सिंक फीचर्स
फ़ाइल साझाकरण या बैकअप सेवाएं
अविश्वसनीय कनेक्टिविटी वाले एप्लिकेशन
विचार योग्य बातें
स्टोरेज की अनुमति का सावधानीपूर्वक निपटारा करने की आवश्यकता है
बड़े फाइलों के लिए महत्वपूर्ण स्मृति का उपभोग कर सकता है
नेटवर्क फेल होने के लिए उचित त्रुटि संभाल की आवश्यकता है
छोटे फ़ाइल स्थानांतरण के लिए आदर्श नहीं
कुछ प्लेटफॉर्म पर स्थिर बैकग्राउंड निष्पादन पर निर्भर है
मूल README
संबंधित सोर्स रिपॉज़िटरी के मूल README का स्नैपशॉट। नवीनतम सामग्री के लिए रिपॉज़िटरी देखें।
flutter_chunked_upload
A Flutter package for handling chunked file uploads with resume capability, progress tracking, and queue management.
🚀 Demo
Android Demo
iOS Demo
🌟 Features
Chunked File Uploads: Split large files into manageable chunks for reliable uploads
Resume Capability: Automatically resume uploads from where they left off
Queue Management: Manage multiple uploads with priority support
Progress Tracking: Real-time progress updates with callbacks
Pause/Resume/Cancel: Full control over upload operations
Automatic Connectivity Handling: Pause uploads when internet is lost, resume when restored
Persistent Storage: Upload progress saved using Hive for app restarts
Cross-Platform: Works on iOS, Android, Web, and Desktop
Backend Agnostic: Works with any server that supports chunked uploads
Notifications: Built-in success, retry, and failure notifications
Error Handling: Comprehensive error handling with automatic retries
The package automatically handles internet connectivity changes:
Internet Lost: All active uploads are automatically paused
Internet Restored: All paused uploads are automatically resumed
No Manual Intervention: Works seamlessly in the background
Progress Preserved: No data loss during connectivity changes
// The connectivity handling is automatic - no additional code needed!// Uploads will pause when internet is lost and resume when restored
Managing Uploads
// Pause an upload
queueManager.pauseJob('job_id');
// Resume an upload
queueManager.resumeJob('job_id');
// Cancel an upload
queueManager.cancelJob('job_id');
// Get all pending jobsfinal pendingJobs = await queueManager.getPendingJobs();
// Get paused jobsfinal pausedJobs = await queueManager.getPausedJobs();
// Clear all jobs
queueManager.clearAllJobs();
Using the Debug Panel
import'package:flutter/material.dart';
import'package:flutter_chunked_upload/flutter_chunked_upload.dart';
classMyAppextendsStatelessWidget{
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Upload Manager')),
body: UploadJobsDebugPanel(), // Shows all upload jobs with controls
),
);
}
}
Custom Storage Adapters
You can implement custom storage adapters for different persistence needs:
classCustomJobStorageAdapterimplementsUploadJobStorageAdapter{
// Implement the required methods@overrideFuture<void> saveJob(UploadJob job) async {
// Your custom implementation
}
// ... implement other methods
}
// Use custom adaptersawait queueManager.initAsync(
jobStorage: CustomJobStorageAdapter(),
chunkStorage: CustomChunkStorageAdapter(),
);
API Reference
UploadJob
The main class representing an upload job.
classUploadJob{
String id; // Unique identifierString filePath; // Path to fileString url; // Upload endpointint chunkSize; // Size of each chunkUploadJobStatus status; // Current statusint retryCount; // Number of retriesint maxRetries; // Maximum retriesbool isPaused; // Pause stateint priority; // Queue prioritydouble progress; // Upload progress (0.0-1.0)// CallbacksProgressCallback? onProgress;
UploadCompleteCallback? onComplete;
UploadFailedCallback? onFailed;
HeaderBuilder? headerBuilder;
}
UploadJobStatus
enumUploadJobStatus {
pending, // Waiting in queue
uploading, // Currently uploading
success, // Upload completed
failed, // Upload failed
}