Slivers Uploader
A file upload tool for Flutter, which can be used for slicing large files.
Features
- Pick files using the file picker.
- Split large files into chunks.
- Upload chunks using HTTP multipart requests.
- Handle upload success and failure.
Install
flutter pub add slivers_uploader
Usage
First, create a FileUploader
object:
var uploader = FileUploader();
Then, use the pickFile
method to pick a file:
var file = await uploader.pickFile();
Finally, use the upload
method to upload the file:
await file.upload(
url: 'http://example.com/upload',
onSuccess: () {
print('Upload successful!');
},
onError: () {
print('Upload failed.');
},
);
Dependencies
This plugin depends on the following plugins: