Skip to content
pubscout

download

1.0.1, released 2 years ago by pwa.ir

Cross-platform file downloader for Dart and Flutter projects.

$ flutter pub add download
Source repository

What it does

Downloads files across Android, iOS, web, Windows, macOS, and Linux from streams or URLs. On the web, it caches contents in a Blob and saves to the browser's default location, while on desktop and mobile it saves to absolute or relative paths.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need a cross-platform file downloading mechanism for Flutter or Dart.
  • You are downloading data as a stream or via HTTP response streams.

Skip it when

  • You are targeting older browsers like IE or Edge prior to version 18, or Safari prior to version 10.1.
  • You haven't handled required runtime permissions on mobile platforms.

Strengths

  • Supports a wide range of platforms including mobile, desktop, and web.
  • Simple API accepting streams or data inputs.

Weaknesses

  • Requires manual permission handling on mobile platforms.
  • Not supported on older versions of certain browsers.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

On mobile, you should ask/ensure the app has the required permissions to save files.

final stream = Stream.fromIterable('Hello World!'.codeUnits);
download(stream, 'hello.txt');

Alternatives

Packages that do the same job and could replace download.