Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
bostrot committed Dec 4, 2022
1 parent 7a70e59 commit 71d72b8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@ Dart downloader that lets you set a custom chunk sizes for a lot faster download
## Getting started

Add this package to your pubspec.yml:

chunked_downloader: x.x.x

## Usage

You can use it like this: (note that everything is in bytes)

```dart
var chunkedDownloader = await ChunkedDownloader(
url: 'https://filesamples.com/samples/video/mjpeg/sample_3840x2160.mjpeg',
savedDir: '/temp',
fileName: 'sometestfile.mjpeg',
chunkSize: 1024 * 1024,
onError: (error) {},
onProgress: (received, total, speed) {},
onDone: (file) {})
.start();
var chunkedDownloader = await ChunkedDownloader(
url: 'https://filesamples.com/samples/video/mjpeg/sample_3840x2160.mjpeg',
savedDir: '/temp',
fileName: 'sometestfile.mjpeg',
chunkSize: 1024 * 1024,
onError: (error) {},
onProgress: (received, total, speed) {},
onDone: (file) {})
.start();
chunkedDownloader.pause();
chunkedDownloader.resume();
Expand Down

0 comments on commit 71d72b8

Please sign in to comment.