chunked_uploader 1.1.0 copy "chunked_uploader: ^1.1.0" to clipboard
chunked_uploader: ^1.1.0 copied to clipboard

An easy-to-use package to upload files in chunks using Dio for mobile, desktop and web.

Chunked Uploader #

A plugin to upload files to server in chunks.

pub package

Usage #

To use this plugin, add chunked_uploader as dependency in your pubspec.yaml file.

dependencies:
  flutter:
    sdk: flutter
  chunked_uploader: ^1.0.0
  file_picker: ^5.2.5
  dio: ^4.0.6

Example #

final file =
    (await FilePicker.platform.pickFiles(withReadStream: true))!.files.single;
final dio = Dio(BaseOptions(
  baseUrl: 'https://example.com/api',
  headers: {'Authorization': 'Bearer'},
));
final uploader = ChunkedUploader(dio);

// using data stream
final response = await uploader.upload(
  fileName: file.name,
  fileSize: file.size,
  fileDataStream: file.readStream!,
  maxChunkSize: 500000,
  path: '/file',
  onUploadProgress: (progress) => print(progress),
);
// using path
final response = await uploader.uploadUsingFilePath(
  fileName: file.name,
  filePath: file.path!,
  maxChunkSize: 500000,
  path: '/file',
  onUploadProgress: (progress) => print(progress),
);
35
likes
150
pub points
87%
popularity

Publisher

unverified uploader

An easy-to-use package to upload files in chunks using Dio for mobile, desktop and web.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

async, dio, universal_io

More

Packages that depend on chunked_uploader